diff options
author | Damjan Marion <damarion@cisco.com> | 2020-09-17 10:40:44 +0200 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2020-09-17 21:38:37 +0200 |
commit | bdbb0c5436b52b4dc6c35d05f227cdf934306d83 (patch) | |
tree | 1dd54d3763d44b3e1eabda6f592c766c31993549 /src/vppinfra/mem_dlmalloc.c | |
parent | e6b83059af3365ab12bbe93655a7dea6f691dbda (diff) |
stats: configurable page size
Type: improvement
Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/mem_dlmalloc.c')
-rw-r--r-- | src/vppinfra/mem_dlmalloc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vppinfra/mem_dlmalloc.c b/src/vppinfra/mem_dlmalloc.c index 50dc57a60bd..10d3c61c77e 100644 --- a/src/vppinfra/mem_dlmalloc.c +++ b/src/vppinfra/mem_dlmalloc.c @@ -543,6 +543,19 @@ mheap_alloc_with_lock (void *memory, uword size, int locked) } } +void * +clib_mem_create_heap (void *base, uword size, char *fmt, ...) +{ + base = clib_mem_vm_map_internal (base, CLIB_MEM_PAGE_SZ_DEFAULT, size, -1, + 0, "str"); + + if (base == 0) + return 0; + + create_mspace_with_base (base, size, 1 /* locked */ ); + return base; +} + /* * fd.io coding-style-patch-verification: ON * |