Explorar o código

Add some comments on sys_alloc()

Ioannis Koutras %!s(int64=13) %!d(string=hai) anos
pai
achega
fe3a2c709d
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/sys_alloc.c

+ 2 - 0
src/sys_alloc.c

@@ -77,9 +77,11 @@ void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
     }
 
 #ifndef WITH_MEMORY_SPACE_AWARENESS
+    // TODO Make the page size configurable at design time
     if(size + HEADER_SIZE < 4096) {
         allocation_size = 4096;
     } else {
+        /* If allocation size is more than 4k, then request multiples of 4k */
         allocation_size = ((size + HEADER_SIZE) / 4096 + 1) * 4096;
     }
 #ifdef WITH_MMAP