Переглянути джерело

head_id is not needed on memory space-aware allocators.

Ioannis Koutras 13 роки тому
батько
коміт
e75ad753c9
2 змінених файлів з 3 додано та 2 видалено
  1. 2 1
      src/custom_free.c
  2. 1 1
      src/custom_malloc.c

+ 2 - 1
src/custom_free.c

@@ -29,7 +29,7 @@
 
 void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
     size_t size;
-    int heap_id, fixed_list_id, i;
+    int fixed_list_id, i;
     maptable_node_t *current_maptable_node;
 #if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
     bool coalesced;
@@ -37,6 +37,7 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
 #endif /* COALESCING_FIXED || COALESCING_VARIABLE */
 
 #ifndef WITH_MEMORY_SPACE_AWARENESS
+    int heap_id;
     /* Currently all the memory space aware allocators are pre-initialized */
     if(allocator == NULL) {
         allocator = &systemallocator;

+ 1 - 1
src/custom_malloc.c

@@ -32,13 +32,13 @@
 
 void * custom_ahmalloc(allocator_t* allocator, heap_t* heap, size_t size) {
     void *ptr;
-    int heap_id;
 #if defined (SPLITTING_FIXED) || defined (SPLITTING_VARIABLE)
     size_t new_size;
     size_t min_split_size;
 #endif /* (SPLITTING_FIXED) || (SPLITTING_VARIABLE) */
 
 #ifndef WITH_MEMORY_SPACE_AWARENESS
+    int heap_id;
 
     /* Go to the system allocator if none was given */
     if(allocator == NULL) {