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

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

Ioannis Koutras 14 роки тому
батько
коміт
1ce79ef85c
1 змінених файлів з 3 додано та 0 видалено
  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) {