qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: "Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org
Subject: [PULL 29/29] plugins/hotpages: Properly freed the hash table values
Date: Mon, 17 May 2021 17:10:22 +0100	[thread overview]
Message-ID: <20210517161022.13984-30-alex.bennee@linaro.org> (raw)
In-Reply-To: <20210517161022.13984-1-alex.bennee@linaro.org>

From: Mahmoud Mandour <ma.mandourr@gmail.com>

Allocated ``pages`` hash table through ``g_hash_table_new_full`` to
add a freeing function & destroyed the hash table on exit.

Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210422005043.3569-3-ma.mandourr@gmail.com>
Message-Id: <20210505092259.8202-5-alex.bennee@linaro.org>

diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c
index bf53267532..9cf7f02c77 100644
--- a/contrib/plugins/hotpages.c
+++ b/contrib/plugins/hotpages.c
@@ -97,13 +97,14 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
         g_list_free(it);
     }
 
+    g_hash_table_destroy(pages);
     qemu_plugin_outs(report->str);
 }
 
 static void plugin_init(void)
 {
     page_mask = (page_size - 1);
-    pages = g_hash_table_new(NULL, g_direct_equal);
+    pages = g_hash_table_new_full(NULL, g_direct_equal, NULL, g_free);
 }
 
 static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo,
-- 
2.20.1



  parent reply	other threads:[~2021-05-17 16:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 16:09 [PULL 00/29] testing and plugin updates Alex Bennée
2021-05-17 16:09 ` [PULL 01/29] tests/docker: fix copying of executable in "update" Alex Bennée
2021-05-17 16:09 ` [PULL 02/29] tests/docker: make executable an optional argument to "update" Alex Bennée
2021-05-17 16:09 ` [PULL 03/29] tests/docker: allow "update" to add the current user Alex Bennée
2021-05-17 16:09 ` [PULL 04/29] tests/docker: add "fetch" sub-command Alex Bennée
2021-05-17 16:09 ` [PULL 05/29] docker: Add Hexagon image Alex Bennée
2021-05-17 16:09 ` [PULL 06/29] tests/tcg: Use Hexagon Docker image Alex Bennée
2021-05-17 16:10 ` [PULL 07/29] tests/docker: Added libbpf library to the docker files Alex Bennée
2021-05-17 16:10 ` [PULL 08/29] tests/tcg: Run timeout cmds using --foreground Alex Bennée
2021-05-17 16:10 ` [PULL 09/29] hw/tricore: Add testdevice for tests in tests/tcg/ Alex Bennée
2021-05-17 16:10 ` [PULL 10/29] tests/tcg/tricore: Add build infrastructure Alex Bennée
2021-05-17 16:10 ` [PULL 11/29] configure: Emit HOST_CC to config-host.mak Alex Bennée
2021-05-17 16:10 ` [PULL 12/29] tests/tcg/tricore: Add macros to create tests and first test 'abs' Alex Bennée
2021-05-17 16:10 ` [PULL 13/29] tests/tcg/tricore: Add bmerge test Alex Bennée
2021-05-17 16:10 ` [PULL 14/29] tests/tcg/tricore: Add clz test Alex Bennée
2021-05-17 16:10 ` [PULL 15/29] tests/tcg/tricore: Add dvstep test Alex Bennée
2021-05-17 16:10 ` [PULL 16/29] tests/tcg/tricore: Add fadd test Alex Bennée
2021-05-17 16:10 ` [PULL 17/29] tests/tcg/tricore: Add fmul test Alex Bennée
2021-05-17 16:10 ` [PULL 18/29] tests/tcg/tricore: Add ftoi test Alex Bennée
2021-05-17 16:10 ` [PULL 19/29] tests/tcg/tricore: Add madd test Alex Bennée
2021-05-17 16:10 ` [PULL 20/29] tests/tcg/tricore: Add msub test Alex Bennée
2021-05-17 16:10 ` [PULL 21/29] tests/tcg/tricore: Add muls test Alex Bennée
2021-05-17 16:10 ` [PULL 22/29] tests/tcg/ppc64le: tests for brh/brw/brd Alex Bennée
2021-05-17 16:10 ` [PULL 23/29] tests/tcg: fix missing return Alex Bennée
2021-05-17 16:10 ` [PULL 24/29] tests/tcg: don't allow clang as a cross compiler Alex Bennée
2021-05-17 16:10 ` [PULL 25/29] configure: use cc, not host_cc to set cross_cc for build arch Alex Bennée
2021-05-17 16:10 ` [PULL 26/29] plugins: Update qemu-plugins.symbols to match qemu-plugins.h Alex Bennée
2021-05-17 16:10 ` [PULL 27/29] plugins: Move all typedef and type declaration to the front of the qemu-plugin.h Alex Bennée
2021-05-17 16:10 ` [PULL 28/29] plugins/hotblocks: Properly freed the hash table values Alex Bennée
2021-05-17 16:10 ` Alex Bennée [this message]
2021-05-17 17:09 ` [PULL 00/29] testing and plugin updates no-reply
2021-05-17 17:37 ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210517161022.13984-30-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=ma.mandourr@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).