Browse Source

Big blocks should not include the size of extra headers

Ioannis Koutras 12 years ago
parent
commit
29a2c96347
1 changed files with 2 additions and 1 deletions
  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);