Преглед на файлове

No need to check ptr for NULL before searching the free list if the fixed lists are disabled.

Ioannis Koutras преди 13 години
родител
ревизия
84e4947ba2
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/custom_malloc.c

+ 3 - 1
src/custom_malloc.c

@@ -70,11 +70,13 @@ void * custom_ahmalloc(allocator_t* allocator, heap_t* heap, size_t size) {
 
 #ifdef WITH_FIXED_LISTS
     ptr = search_on_fixed(heap, req_padding(size));
-#endif /* WITH_FIXED_LISTS */
 
     if(ptr == NULL) {
+#endif /* WITH_FIXED_LISTS */
        ptr = best_fit_on_freelist(heap, size);
+#ifdef WITH_FIXED_LISTS
     }
+#endif /* WITH_FIXED_LISTS */
 
     if(ptr != NULL) {