Changeset 1925 for trunk/src/kmk/make.h
- Timestamp:
- Oct 24, 2008, 5:32:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/make.h
r1918 r1925 196 196 #endif 197 197 198 #ifdef CONFIG_WITH_MAKE_STATS 199 extern long make_stats_allocations; 200 extern unsigned long make_stats_allocated; 201 extern unsigned long make_stats_allocated_sum; 202 extern unsigned long make_stats_ht_lookups; 203 extern unsigned long make_stats_ht_collisions; 204 205 # ifdef __APPLE__ 206 # include <malloc/malloc.h> 207 # define SIZE_OF_HEAP_BLOCK(ptr) malloc_size(ptr) 208 209 # elif defined(__linux__) /* glibc */ 210 # include <malloc.h> 211 # define SIZE_OF_HEAP_BLOCK(ptr) malloc_usable_size(ptr) 212 213 # elif defined(_MSC_VER) || defined(__OS2__) 214 # define SIZE_OF_HEAP_BLOCK(ptr) _msize(ptr) 215 216 # else 217 # include <stdlib.h> 218 # define SIZE_OF_HEAP_BLOCK(ptr) 0 219 #endif 220 221 # if defined(CONFIG_WITH_MAKE_STATS) && !defined(ELECTRIC_HEAP) 222 # define free xfree 223 extern void xfree (void *); 224 # endif 225 226 # define MAKE_STATS_3(expr) do { expr; } while (0) 227 # define MAKE_STATS_2(expr) do { expr; } while (0) 228 # define MAKE_STATS(expr) do { expr; } while (0) 229 #else 230 # define MAKE_STATS_3(expr) do { } while (0) 231 # define MAKE_STATS_2(expr) do { } while (0) 232 # define MAKE_STATS(expr) do { } while (0) 233 #endif 234 235 198 236 #ifndef CHAR_BIT 199 237 # define CHAR_BIT 8 … … 514 552 struct alloccache_free_ent *free_head; 515 553 unsigned int size; 516 unsigned int alloc_count;517 554 unsigned int total_count; 555 unsigned long alloc_count; 556 unsigned long free_count; 518 557 const char *name; 519 558 struct alloccache *next; … … 545 584 else 546 585 f = alloccache_alloc_grow (cache); 547 cache->alloc_count++;586 MAKE_STATS(cache->alloc_count++;); 548 587 return f; 549 588 } … … 573 612 f->next = cache->free_head; 574 613 cache->free_head = f; 575 cache->alloc_count--;614 MAKE_STATS(cache->free_count++;); 576 615 } 577 616 … … 855 894 #endif /* __EMX__ (bird) */ 856 895 857 #ifdef CONFIG_WITH_MAKE_STATS858 extern long make_stats_allocations;859 extern unsigned long make_stats_allocated;860 extern unsigned long make_stats_allocated_sum;861 extern unsigned long make_stats_ht_lookups;862 extern unsigned long make_stats_ht_collisions;863 864 # ifdef __APPLE__865 # include <malloc/malloc.h>866 # define SIZE_OF_HEAP_BLOCK(ptr) malloc_size(ptr)867 868 # elif defined(__linux__) /* glibc */869 # include <malloc.h>870 # define SIZE_OF_HEAP_BLOCK(ptr) malloc_usable_size(ptr)871 872 # elif defined(_MSC_VER) || defined(__OS2__)873 # define SIZE_OF_HEAP_BLOCK(ptr) _msize(ptr)874 875 # else876 # include <stdlib.h>877 # define SIZE_OF_HEAP_BLOCK(ptr) 0878 #endif879 880 # if defined(CONFIG_WITH_MAKE_STATS) && !defined(ELECTRIC_HEAP)881 # define free xfree882 extern void xfree (void *);883 # endif884 885 # define MAKE_STATS_3(expr) do { expr; } while (0)886 # define MAKE_STATS_2(expr) do { expr; } while (0)887 # define MAKE_STATS(expr) do { expr; } while (0)888 #else889 # define MAKE_STATS_3(expr) do { } while (0)890 # define MAKE_STATS_2(expr) do { } while (0)891 # define MAKE_STATS(expr) do { } while (0)892 #endif893 894 896 #ifdef CONFIG_WITH_IF_CONDITIONALS 895 897 extern int expr_eval_if_conditionals(char *line, const struct floc *flocp);
Note:
See TracChangeset
for help on using the changeset viewer.