Bladeren bron

Fixed allocation size for big block malloc()

Ioannis Koutras 12 jaren geleden
bovenliggende
commit
625d95c720
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      src/dmmlib.c

+ 3 - 2
src/dmmlib.c

@@ -79,11 +79,12 @@ void * malloc(size_t 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);
+                        " bytes at %p\n", size + sizeof(raw_block_header_t),
+                        (void *)ptr);
 
 #ifdef WITH_ALLOCATOR_STATS
                 systemallocator.dmm_stats.total_mem_allocated +=
-                    allocation_size;
+                    size + sizeof(raw_block_header_t);
                 systemallocator.dmm_stats.live_objects++;
                 systemallocator.dmm_stats.num_malloc++;
                 TRACE_1("dmmlib - global allocated memory: %zu bytes\n",