Browse Source

Check for owner before coalescing only if block has ownsership information.

Ioannis Koutras 13 years ago
parent
commit
1b99b0d3e0
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/custom_free.c

+ 4 - 0
src/custom_free.c

@@ -72,7 +72,9 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
 #if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
     coalesced = false;
     if(is_previous_free(ptr)) {
+#ifdef WITH_OWNERSHIP
         if(get_owner(ptr) == get_owner(get_dlprevious(ptr))) {
+#endif /* WITH_OWNERSHIP */
 
 #ifdef COALESCING_FIXED
             max_coal_size = MAX_COALESCE_SIZE;
@@ -88,7 +90,9 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
             } else {
                 mark_free(ptr);
             }
+#ifdef WITH_OWNERSHIP
         }
+#endif /* WITH_OWNERSHIP */
     } else {
 #endif /* COALESCING_FIXED || COALESCING_VARIABLE */
         mark_free(ptr);