Forráskód Böngészése

Simplified some options on Linux test, introduced option to replace the classic function calls with dmmlib ones.

Ioannis Koutras 13 éve
szülő
commit
1708f3e6ba
4 módosított fájl, 12 hozzáadás és 5 törlés
  1. 1 0
      CMakeLists.txt
  2. 4 5
      DefineOptions.cmake
  3. 1 0
      dmm_config.h.in
  4. 6 0
      include/dmmlib/dmmlib.h

+ 1 - 0
CMakeLists.txt

@@ -65,5 +65,6 @@ if(MIN_SPLITTING_SIZE)
 endif(MIN_SPLITTING_SIZE)
 message(STATUS "Adaptivity: " ${WITH_ADAPTIVITY})
 message(STATUS "Support for realloc(): " ${WITH_REALLOC})
+message(STATUS "Replace function calls: " ${REPLACE_MALLOC})
 message(STATUS "********************************************")
 

+ 4 - 5
DefineOptions.cmake

@@ -3,12 +3,13 @@ option(WITH_REALLOC "Build with realloc" OFF)
 option(WITH_EXAMPLES "Build with examples" OFF)
 option(WITH_MEMORY_SPACE_AWARENESS "Build with memory space awareness" OFF)
 option(WITH_FIXED_LISTS "Build with predefined lists of fixed-sized blocks" ON)
-option(WITH_STATS "Build with statistics" ON)
+option(WITH_STATS "Build with statistics" OFF)
 option(WITH_KNOBS "Build with knobs support" OFF)
 option(WITH_ADAPTIVITY "Build with adaptivity" OFF)
 option(WITH_STATIC_LIB "Build a static library" OFF)
 option(WITH_SHARED_LIB "Build a shared library" OFF)
 option(WITH_DOC "Build with documentation" OFF)
+option(REPLACE_MALLOC "Replace function calls" OFF)
 
 set(NUM_HEAPS 1)
 
@@ -34,7 +35,6 @@ if (P2012)
   set(NUM_HEAPS 1)
   set(LINUXTEST OFF)
   set(WITH_FIXED_LISTS OFF)
-  set(WITH_STATS OFF)
   set(WITH_COALESCING "never")
   set(WITH_SPLITTING "never")
   set(BLOCKS_ORGANIZATION "sll")
@@ -47,7 +47,6 @@ if (LEON3)
   set(NUM_HEAPS 1)
   set(LINUXTEST OFF)
   set(WITH_FIXED_LISTS OFF)
-  set(WITH_STATS OFF)
   set(WITH_COALESCING "fixed")
   set(MAX_COALESCE_SIZE 60000)
   set(WITH_SPLITTING "never")
@@ -62,9 +61,9 @@ if (LINUXTEST)
   set(WITH_SPLITTING "variable")
   set(MIN_SPLITTING_SIZE 300)
   set(WITH_SHARED_LIB ON)
-  set(WITH_DOC ON)
+  set(WITH_STATIC_LIB ON)
   set(WITH_REALLOC ON)
-  set(BLOCKS_ORGANIZATION "dll")
+  set(REPLACE_MALLOC ON)
 endif (LINUXTEST)
 
 if(BLOCKS_ORGANIZATION STREQUAL "dll")

+ 1 - 0
dmm_config.h.in

@@ -34,6 +34,7 @@
 
 #define MIN_FRAG_THRESHOLD 0.05
 
+#cmakedefine REPLACE_MALLOC
 
 #endif /* DMM_CONFIG_H */
 

+ 6 - 0
include/dmmlib/dmmlib.h

@@ -30,5 +30,11 @@ void custom_free(void *ptr);
 allocator_t systemallocator;
 #endif /* WITH_MEMORY_SPACE_AWARENESS */
 
+#ifdef REPLACE_MALLOC
+
+#define malloc(size) custom_ahmalloc(NULL, NULL, size)
+#define free(ptr) custom_ahfree(NULL, NULL, ptr)
+
+#endif /* REPLACE_MALLOC */
 
 #endif /* DMMLIB_H */