Add config option to use dlmalloc instead of mheap

Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk

src/vppinfra/dlmalloc.[ch] are slightly modified versions of the
well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no
inherent size limit.

Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/src/vppinfra.am b/src/vppinfra.am
index e751de2..7641c71 100644
--- a/src/vppinfra.am
+++ b/src/vppinfra.am
@@ -248,7 +248,6 @@
   vppinfra/memcpy_avx512.h \
   vppinfra/mhash.h \
   vppinfra/mheap.h \
-  vppinfra/mheap_bootstrap.h \
   vppinfra/os.h \
   vppinfra/pipeline.h \
   vppinfra/pool.h \
@@ -290,6 +289,14 @@
   vppinfra/xy.h \
   vppinfra/zvec.h
 
+if ENABLE_DLMALLOC
+  nobase_include_HEADERS += \
+  vppinfra/dlmalloc.h
+else
+  nobase_include_HEADERS +=  \
+  vppinfra/mheap_bootstrap.h 
+endif
+
 CLIB_CORE = \
   vppinfra/asm_x86.c \
   vppinfra/backtrace.c \
@@ -314,8 +321,6 @@
   vppinfra/longjmp.S \
   vppinfra/macros.c \
   vppinfra/mhash.c \
-  vppinfra/mheap.c \
-  vppinfra/mem_mheap.c \
   vppinfra/ptclosure.c \
   vppinfra/random.c \
   vppinfra/random_buffer.c \
@@ -344,6 +349,17 @@
   vppinfra/vector.c \
   vppinfra/zvec.c
 
+if ENABLE_DLMALLOC
+  CLIB_CORE += \
+  vppinfra/mem_dlmalloc.c \
+  vppinfra/dlmalloc.c \
+  vppinfra/dlmalloc.h
+else
+  CLIB_CORE += \
+  vppinfra/mheap.c \
+  vppinfra/mem_mheap.c 
+endif
+
 # Core plus Unix additions
 libvppinfra_la_SOURCES =			\
   $(CLIB_CORE)					\