Parcourir la source

Proper support for enabling coalescing.

Ioannis Koutras il y a 13 ans
Parent
commit
8de91b5f18
3 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 1 0
      DefineOptions.cmake
  2. 2 0
      dmm_config.h.in
  3. 1 1
      src/custom_free.c

+ 1 - 0
DefineOptions.cmake

@@ -1,6 +1,7 @@
 option(HAVE_LOCKS "Build with POSIX locking mechanisms" ON)
 option(WITH_EXAMPLES "Build with examples" OFF)
 option(WITH_MEMORY_SPACE_AWARENESS "Build with memory space awareness" OFF)
+option(WITH_COALESCING "Build with coalescing support" 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)

+ 2 - 0
dmm_config.h.in

@@ -11,5 +11,7 @@
 
 #define MIN_FRAG_THRESHOLD 0.05
 
+#define WITH_COALESCING
+
 #endif /* DMM_CONFIG_H */
 

+ 1 - 1
src/custom_free.c

@@ -32,7 +32,7 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
     remove_block(ptr, heap->used_blocks_head);
 
 #ifdef WITH_COALESCING
-    ptr = coalesce(heap, ptr); 
+    ptr = coalesce(ptr, heap); 
 #endif /* WITH_COALESCING */
 
     // Check if the block could be put in a fixed list