Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add missing API MAC address encode implementation
[vpp.git]
/
src
/
vppinfra
/
dlmalloc.c
diff --git
a/src/vppinfra/dlmalloc.c
b/src/vppinfra/dlmalloc.c
index
8ae92cf
..
16f2de0
100644
(file)
--- a/
src/vppinfra/dlmalloc.c
+++ b/
src/vppinfra/dlmalloc.c
@@
-1612,7
+1612,11
@@
static size_t traverse_and_check(mstate m);
#if (FOOTERS && !INSECURE)
/* Check if (alleged) mstate m has expected magic field */
#if (FOOTERS && !INSECURE)
/* Check if (alleged) mstate m has expected magic field */
-#define ok_magic(M) ((M)->magic == mparams.magic)
+static inline int
+ok_magic (const mstate m)
+{
+ return (m->magic == mparams.magic);
+}
#else /* (FOOTERS && !INSECURE) */
#define ok_magic(M) (1)
#endif /* (FOOTERS && !INSECURE) */
#else /* (FOOTERS && !INSECURE) */
#define ok_magic(M) (1)
#endif /* (FOOTERS && !INSECURE) */
@@
-2074,8
+2078,8
@@
static void do_check_malloc_state(mstate m) {
/* ----------------------------- statistics ------------------------------ */
#if !NO_MALLINFO
/* ----------------------------- statistics ------------------------------ */
#if !NO_MALLINFO
-static struct mallinfo internal_mallinfo(mstate m) {
- struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static struct
dl
mallinfo internal_mallinfo(mstate m) {
+ struct
dl
mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
ensure_initialization();
if (!PREACTION(m)) {
check_malloc_state(m);
ensure_initialization();
if (!PREACTION(m)) {
check_malloc_state(m);
@@
-3959,7
+3963,7
@@
size_t dlmalloc_set_footprint_limit(size_t bytes) {
}
#if !NO_MALLINFO
}
#if !NO_MALLINFO
-struct mallinfo dlmallinfo(void) {
+struct
dl
mallinfo dlmallinfo(void) {
return internal_mallinfo(gm);
}
#endif /* NO_MALLINFO */
return internal_mallinfo(gm);
}
#endif /* NO_MALLINFO */
@@
-4116,6
+4120,10
@@
int mspace_is_heap_object (mspace msp, void *p)
return 1;
this_seg = this_seg->next;
}
return 1;
this_seg = this_seg->next;
}
+
+ if (pp > ms->least_addr && pp <= ms->least_addr + ms->footprint)
+ return 1;
+
return 0;
}
return 0;
}
@@
-4271,6
+4279,14
@@
void mspace_put (mspace msp, void *p_arg)
mheap_put_trace ((u64)p_arg, psize);
}
mheap_put_trace ((u64)p_arg, psize);
}
+#if CLIB_DEBUG > 0
+ /* Poison the object */
+ {
+ size_t psize = mspace_usable_size (object_header);
+ memset (object_header, 0x13, psize);
+ }
+#endif
+
/* And free it... */
mspace_free (msp, object_header);
}
/* And free it... */
mspace_free (msp, object_header);
}
@@
-4765,7
+4781,7
@@
size_t mspace_set_footprint_limit(mspace msp, size_t bytes) {
}
#if !NO_MALLINFO
}
#if !NO_MALLINFO
-struct mallinfo mspace_mallinfo(mspace msp) {
+struct
dl
mallinfo mspace_mallinfo(mspace msp) {
mstate ms = (mstate)msp;
if (!ok_magic(ms)) {
USAGE_ERROR_ACTION(ms,ms);
mstate ms = (mstate)msp;
if (!ok_magic(ms)) {
USAGE_ERROR_ACTION(ms,ms);