Changeset 1438 for trunk/src/kmk/misc.c
- Timestamp:
- Mar 29, 2008, 2:49:27 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/misc.c
r909 r1438 361 361 if (result == 0) 362 362 fatal (NILF, _("virtual memory exhausted")); 363 #ifdef CONFIG_WITH_MAKE_STATS 364 make_stats_allocations++; 365 make_stats_allocated += SIZE_OF_HEAP_BLOCK (result); 366 make_stats_allocated_sum += SIZE_OF_HEAP_BLOCK (result); 367 #endif 363 368 return result; 364 369 } … … 369 374 { 370 375 void *result; 376 #ifdef CONFIG_WITH_MAKE_STATS 377 make_stats_allocated -= SIZE_OF_HEAP_BLOCK (ptr); 378 make_stats_allocated_sum -= SIZE_OF_HEAP_BLOCK (ptr); 379 #endif 371 380 372 381 /* Some older implementations of realloc() don't conform to ANSI. */ … … 376 385 if (result == 0) 377 386 fatal (NILF, _("virtual memory exhausted")); 387 #ifdef CONFIG_WITH_MAKE_STATS 388 make_stats_allocated += SIZE_OF_HEAP_BLOCK (result); 389 make_stats_allocated_sum += SIZE_OF_HEAP_BLOCK (result); 390 #endif 378 391 return result; 379 392 } … … 394 407 fatal (NILF, _("virtual memory exhausted")); 395 408 409 #ifdef CONFIG_WITH_MAKE_STATS 410 make_stats_allocations++; 411 make_stats_allocated += SIZE_OF_HEAP_BLOCK (result); 412 make_stats_allocated_sum += SIZE_OF_HEAP_BLOCK (result); 413 #endif 396 414 #ifdef HAVE_STRDUP 397 415 return result; … … 924 942 } 925 943 } 944 945 #if defined(CONFIG_WITH_MAKE_STATS) && !defined(ELECTRIC_HEAP) 946 #undef free 947 void xfree(void *ptr) 948 { 949 if (ptr) 950 { 951 make_stats_allocations--; 952 make_stats_allocated -= SIZE_OF_HEAP_BLOCK (ptr); 953 free (ptr); 954 } 955 } 956 #endif 957
Note:
See TracChangeset
for help on using the changeset viewer.