瀏覽代碼

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) {