Browse Source

Fixed some old calls in split() and moved some unused local variables in split() and coalesce().

Ioannis Koutras 13 years ago
parent
commit
28552fef31
2 changed files with 6 additions and 4 deletions
  1. 1 1
      src/coalesce.c
  2. 5 3
      src/split.c

+ 1 - 1
src/coalesce.c

@@ -24,8 +24,8 @@ void * coalesce(allocator_t *allocator, heap_t *heap, void *ptr, size_t size) {
     void *prev;
 #ifdef WITH_FIXED_LISTS
     int fixed_list_id, i;
-#endif /* WITH_FIXED_LISTS */
     maptable_node_t *current_maptable_node;
+#endif /* WITH_FIXED_LISTS */
 
     prev = get_dlprevious(ptr);
 

+ 5 - 3
src/split.c

@@ -23,17 +23,19 @@
 void split(allocator_t *allocator, heap_t *heap, void *ptr,
         size_t req_size) {
     void *new_block;
-    int fixed_list_id, i;
     size_t new_block_size;
+#ifdef WITH_FIXED_LISTS
+    int fixed_list_id, i;
     maptable_node_t *current_maptable_node;
+#endif /* WITH_FIXED_LISTS */
 
     new_block = (void *) ((char *) ptr + req_size + HEADER_SIZE);
     new_block_size = get_size(ptr) - req_size - HEADER_SIZE;
 
     /* Resize the previous, to be used block */
-    set_size_and_used(ptr, req_size);
+    set_size_and_used(allocator, ptr, req_size);
 
-    set_size_and_free(new_block, new_block_size);
+    set_size_and_free(allocator, new_block, new_block_size);
     set_previous_size_availability(new_block, get_size_availability(ptr));
 
 #ifdef WITH_FIXED_LISTS