summaryrefslogtreecommitdiffstats
path: root/src/svm/svm.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-10-06 17:46:06 +0200
committerDamjan Marion <damarion@cisco.com>2020-10-06 23:47:33 +0200
commitbfa75d6b922ee15d2f0d00999fd36b03a85eda8c (patch)
treeddd1341db08ae2020c37333d31c949d883ef6bc2 /src/svm/svm.h
parentab1a50cf7407e31097b550226c2b6954d6371bea (diff)
vppinfra: add heap header in front of dlmalloc space
This patch adds smal header in front of dlmalloc space, and it stores some additional information about the heap. Immediate benefit of this patch is that we know the underlying page size si we can display heap page statistics / real memory usage. Type: improvement Change-Id: Ibd6989cc2f2f64630ab08734c9552e15029c5f3f Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/svm/svm.h')
-rw-r--r--src/svm/svm.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/svm/svm.h b/src/svm/svm.h
index 894c3d95494..8bf561e9a81 100644
--- a/src/svm/svm.h
+++ b/src/svm/svm.h
@@ -31,7 +31,7 @@
static inline void *
svm_mem_alloc (svm_region_t * rp, uword size)
{
- u8 *oldheap;
+ clib_mem_heap_t *oldheap;
ASSERT (rp->flags & SVM_FLAGS_MHEAP);
u8 *rv;
@@ -47,7 +47,7 @@ static inline void *
svm_mem_alloc_aligned_at_offset (svm_region_t * rp,
uword size, uword align, uword offset)
{
- u8 *oldheap;
+ clib_mem_heap_t *oldheap;
ASSERT (rp->flags & SVM_FLAGS_MHEAP);
u8 *rv;
@@ -63,7 +63,7 @@ svm_mem_alloc_aligned_at_offset (svm_region_t * rp,
static inline void
svm_mem_free (svm_region_t * rp, void *ptr)
{
- u8 *oldheap;
+ clib_mem_heap_t *oldheap;
ASSERT (rp->flags & SVM_FLAGS_MHEAP);
pthread_mutex_lock (&rp->mutex);
@@ -77,7 +77,7 @@ svm_mem_free (svm_region_t * rp, void *ptr)
static inline void *
svm_push_pvt_heap (svm_region_t * rp)
{
- u8 *oldheap;
+ clib_mem_heap_t *oldheap;
oldheap = clib_mem_set_heap (rp->region_heap);
return ((void *) oldheap);
}
@@ -85,7 +85,7 @@ svm_push_pvt_heap (svm_region_t * rp)
static inline void *
svm_push_data_heap (svm_region_t * rp)
{
- u8 *oldheap;
+ clib_mem_heap_t *oldheap;
oldheap = clib_mem_set_heap (rp->data_heap);
return ((void *) oldheap);
}