#include <vppinfra/clib.h>
#include <vppinfra/cache.h>
+/* --- begin vpp customizations --- */
+
+#if CLIB_DEBUG > 0
+#define FOOTERS 1 /* extra debugging */
+#define DLM_MAGIC_CONSTANT 0xdeaddabe
+#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
/* 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))
/* #define HAVE_USR_INCLUDE_MALLOC_H */
-#ifdef HAVE_USR_INCLUDE_MALLOC_H
+#if 0 // def HAVE_USR_INCLUDE_MALLOC_H
#include "/usr/include/malloc.h"
#else /* HAVE_USR_INCLUDE_MALLOC_H */
#ifndef STRUCT_MALLINFO_DECLARED
/* HP-UX (and others?) redefines mallinfo unless _STRUCT_MALLINFO is defined */
#define _STRUCT_MALLINFO
#define STRUCT_MALLINFO_DECLARED 1
-struct mallinfo {
+struct dlmallinfo {
MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
MALLINFO_FIELD_TYPE smblks; /* always 0 */
#define dlrealloc_in_place realloc_in_place
#define dlvalloc valloc
#define dlpvalloc pvalloc
-#define dlmallinfo mallinfo
+// #define dlmallinfo mallinfo
#define dlmallopt mallopt
#define dlmalloc_trim malloc_trim
#define dlmalloc_stats malloc_stats
be kept as longs, the reported values may wrap around zero and
thus be inaccurate.
*/
-DLMALLOC_EXPORT struct mallinfo dlmallinfo(void);
+DLMALLOC_EXPORT struct dlmallinfo dlmallinfo(void);
#endif /* NO_MALLINFO */
/*
mspace_mallinfo behaves as mallinfo, but reports properties of
the given space.
*/
-DLMALLOC_EXPORT struct mallinfo mspace_mallinfo(mspace msp);
+DLMALLOC_EXPORT struct dlmallinfo mspace_mallinfo(mspace msp);
#endif /* NO_MALLINFO */
/*