diff options
Diffstat (limited to 'src/hgspy_helper.c')
-rw-r--r-- | src/hgspy_helper.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/hgspy_helper.c b/src/hgspy_helper.c index 14ac3ae..8eff821 100644 --- a/src/hgspy_helper.c +++ b/src/hgspy_helper.c @@ -32,6 +32,7 @@ #include "visualizer.h" +static gpointer __hg_mem_pool_destroy = NULL; static gpointer __hg_mem_pool_add_heap = NULL; static gpointer __hg_mem_alloc_with_flags = NULL; static gpointer __hg_mem_free = NULL; @@ -51,6 +52,10 @@ helper_init(void) g_warning("Failed g_module_open: %s", g_module_error()); exit(1); } + if (!g_module_symbol(__handle, "hg_mem_pool_destroy", &__hg_mem_pool_destroy)) { + g_warning("Failed g_module_symbol: %s", g_module_error()); + exit(1); + } if (!g_module_symbol(__handle, "hg_mem_pool_add_heap", &__hg_mem_pool_add_heap)) { g_warning("Failed g_module_symbol: %s", g_module_error()); exit(1); @@ -82,6 +87,18 @@ helper_finalize(void) * preload functions */ void +hg_mem_pool_destroy(HgMemPool *pool) +{ + gchar *pool_name = g_strdup(hg_mem_pool_get_name(pool)); + + ((void (*) (HgMemPool *))__hg_mem_pool_destroy) (pool); + + hg_memory_visualizer_remove_pool(HG_MEMORY_VISUALIZER (visual), + pool_name); + g_free(pool_name); +} + +void hg_mem_pool_add_heap(HgMemPool *pool, HgHeap *heap) { |