Explorar el Código

Do not initialize inside custom_malloc() when we have memory space aware allocator.

Ioannis Koutras hace 14 años
padre
commit
1ce79ef85c
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/custom_malloc.c

+ 3 - 0
src/custom_malloc.c

@@ -20,9 +20,12 @@ void * custom_ahmalloc(allocator_t* allocator, heap_t* heap, size_t size) {
     // Go to the system allocator if none was given
     if(allocator == NULL) {
         allocator = &systemallocator;
+#ifndef WITH_MEMORY_SPACE_AWARENESS
+        // Currently all the memory space aware allocators are pre-initialized
         if(allocator->initialized != true) {
             initialize_allocator(allocator);
         }
+#endif /* WITH_MEMORY_SPACE_AWARENESS */
     }
 
     if(heap == NULL) {