aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/dlmalloc.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-07-27 11:30:46 -0700
committerFlorin Coras <fcoras@cisco.com>2018-07-27 11:39:14 -0700
commitd055475773b5741276edb818fb27478f532487b4 (patch)
tree2bd440bdc51e08a4b9c2270138805b2beeb1335b /src/vppinfra/dlmalloc.c
parentcd2190e124d723fcde87c1ee636a09410a384e1a (diff)
dlmalloc: use static magic constant for debug images
Avoids crashes on restarts if svm root region backing file was not cleaned up. Change-Id: I608cf5711aa8c3f9620900473bdf76bde8b918de Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vppinfra/dlmalloc.c')
-rw-r--r--src/vppinfra/dlmalloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vppinfra/dlmalloc.c b/src/vppinfra/dlmalloc.c
index 2199d876e91..e5bd1e8a899 100644
--- a/src/vppinfra/dlmalloc.c
+++ b/src/vppinfra/dlmalloc.c
@@ -1765,6 +1765,9 @@ static int init_mparams(void) {
#endif
magic |= (size_t)8U; /* ensure nonzero */
magic &= ~(size_t)7U; /* improve chances of fault for bad values */
+#ifdef DLM_MAGIC_CONSTANT
+ magic = DLM_MAGIC_CONSTANT;
+#endif
/* Until memory modes commonly available, use volatile-write */
(*(volatile size_t *)(&(mparams.magic))) = magic;
}