Explorar el Código

Big blocks should not include the size of extra headers

Ioannis Koutras hace 12 años
padre
commit
29a2c96347
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/dmmlib.c

+ 2 - 1
src/dmmlib.c

@@ -75,7 +75,8 @@ void * malloc(size_t size) {
         if(allocation_size < SYS_ALLOC_SIZE / 2) {
             allocation_size = SYS_ALLOC_SIZE;
         } else {
-            ptr = (void *)create_new_raw_block(allocation_size, BIGBLOCK);
+            ptr = (void *)create_new_raw_block(size +
+                    sizeof(raw_block_header_t), BIGBLOCK);
             if(ptr != NULL) {
                 TRACE_1("dmmlib - malloc - allocated a whole raw block of %zu"
                         " bytes at %p\n", allocation_size, (void *)ptr);