Parcourir la source

Allocator is considered initialized after first sys_alloc, not during initialize_allocator.

Ioannis Koutras il y a 13 ans
Parent
commit
559594aa1c
2 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 0 2
      src/initialize_allocator.c
  2. 1 0
      src/sys_alloc.c

+ 0 - 2
src/initialize_allocator.c

@@ -144,8 +144,6 @@ void initialize_allocator(allocator_t *allocator) {
     (maptablenode+1)->next = NULL;
     (maptablenode+1)->next = NULL;
 #endif /* WITH_FIXED_LISTS */
 #endif /* WITH_FIXED_LISTS */
 
 
-    allocator->initialized = true;
-
 #ifdef HAVE_LOCKS
 #ifdef HAVE_LOCKS
     sbrk_unlock();
     sbrk_unlock();
 #endif /* HAVE_LOCKS */
 #endif /* HAVE_LOCKS */

+ 1 - 0
src/sys_alloc.c

@@ -57,6 +57,7 @@ void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
     } else {
     } else {
         previous_size = 0;
         previous_size = 0;
         previous_size_availability = 1; /* Occupied and of 0 size */
         previous_size_availability = 1; /* Occupied and of 0 size */
+        allocator->initialized = true;
     }
     }
 
 
 #ifndef WITH_MEMORY_SPACE_AWARENESS
 #ifndef WITH_MEMORY_SPACE_AWARENESS