aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vppinfra/mem.h2
-rw-r--r--src/vppinfra/mem_dlmalloc.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h
index 06694ccadeb..c97ee8af157 100644
--- a/src/vppinfra/mem.h
+++ b/src/vppinfra/mem.h
@@ -412,6 +412,8 @@ uword clib_mem_get_default_hugepage_size (void);
int clib_mem_get_fd_log2_page_size (int fd);
uword clib_mem_vm_reserve (uword start, uword size, u32 log2_page_sz);
u64 *clib_mem_vm_get_paddr (void *mem, int log2_page_size, int n_pages);
+void clib_mem_destroy_mspace (void *mspace);
+void clib_mem_destroy (void);
typedef struct
{
diff --git a/src/vppinfra/mem_dlmalloc.c b/src/vppinfra/mem_dlmalloc.c
index 663b2f162f7..1b0dbb24500 100644
--- a/src/vppinfra/mem_dlmalloc.c
+++ b/src/vppinfra/mem_dlmalloc.c
@@ -237,6 +237,23 @@ clib_mem_init_thread_safe (void *memory, uword memory_size)
1 /* do clib_mem_set_heap */ );
}
+void
+clib_mem_destroy_mspace (void *mspace)
+{
+ mheap_trace_main_t *tm = &mheap_trace_main;
+
+ if (tm->enabled && mspace == tm->current_traced_mheap)
+ tm->enabled = 0;
+
+ destroy_mspace (mspace);
+}
+
+void
+clib_mem_destroy (void)
+{
+ clib_mem_destroy_mspace (clib_mem_get_heap ());
+}
+
void *
clib_mem_init_thread_safe_numa (void *memory, uword memory_size, u8 numa)
{