aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/dlmalloc.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-07-26 16:16:55 -0400
committerNeale Ranns <nranns@cisco.com>2018-07-27 07:50:11 +0000
commitdb0a7ec72a2907036b880888fc186ef1c2195b36 (patch)
tree5b5ea7871f4171c4fd76089b17f4dca625bdb3b3 /src/vppinfra/dlmalloc.h
parent2d1a04371a8e61f9d5ba8b028f41fcbcec017b9c (diff)
-DCLIB_DEBUG => turn on extra checks in dlmalloc
Also: call os_panic() on a heap botch crash, attempt to generate a post-mortem API dump, etc. Add an "ugly" test case to vec_test.c, to cause a configurable block overrun. Change-Id: I7b29a7645277f9e485e06ff83335306fedc24b71 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/dlmalloc.h')
-rw-r--r--src/vppinfra/dlmalloc.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vppinfra/dlmalloc.h b/src/vppinfra/dlmalloc.h
index fbc49e35671..b3278f9dc50 100644
--- a/src/vppinfra/dlmalloc.h
+++ b/src/vppinfra/dlmalloc.h
@@ -524,6 +524,17 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
#include <vppinfra/clib.h>
#include <vppinfra/cache.h>
+/* --- begin vpp customizations --- */
+
+#if CLIB_DEBUG > 0
+#define FOOTERS 1 /* extra debugging */
+#endif
+#define USE_LOCKS 1
+#define DLM_ABORT {extern void os_panic(void); os_panic(); abort();}
+#define ONLY_MSPACES 1
+
+/* --- end vpp customizations --- */
+
/* Version identifier to allow people to support multiple versions */
#ifndef DLMALLOC_VERSION
#define DLMALLOC_VERSION 20806
@@ -587,8 +598,6 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
/* The maximum possible size_t value has all bits set */
#define MAX_SIZE_T (~(size_t)0)
-#define USE_LOCKS 1
-
#ifndef USE_LOCKS /* ensure true if spin or recursive locks set */
#define USE_LOCKS ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \
(defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0))