Changeset 1438 for trunk/src/kmk/make.h


Ignore:
Timestamp:
Mar 29, 2008, 2:49:27 AM (17 years ago)
Author:
bird
Message:

Added $(make-stats ) that provides access to memory and hash stats (if CONFIG_WITH_MAKE_STATS is defined).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/make.h

    r903 r1438  
    690690
    691691#endif /* __EMX__ (bird) */
     692
     693#ifdef CONFIG_WITH_MAKE_STATS
     694extern unsigned long make_stats_allocations;
     695extern unsigned long make_stats_allocated;
     696extern unsigned long make_stats_allocated_sum;
     697extern unsigned long make_stats_ht_lookups;
     698extern unsigned long make_stats_ht_collisions;
     699
     700# ifdef __APPLE__
     701#  include <malloc/malloc.h>
     702#  define SIZE_OF_HEAP_BLOCK(ptr)   malloc_size(ptr)
     703
     704# elif defined(__linux__) /* glibc */
     705#  include <malloc.h>
     706#  define SIZE_OF_HEAP_BLOCK(ptr)   malloc_usable_size(ptr)
     707
     708# elif defined(_MSC_VER) || defined(__OS2__)
     709#  define SIZE_OF_HEAP_BLOCK(ptr)   _msize(ptr)
     710
     711# else
     712#  include <stdlib.h>
     713#  define SIZE_OF_HEAP_BLOCK(ptr)   0
     714#endif
     715
     716# if defined(CONFIG_WITH_MAKE_STATS) && !defined(ELECTRIC_HEAP)
     717#  define free xfree
     718extern void xfree (void *);
     719# endif
     720
     721#endif
     722
Note: See TracChangeset for help on using the changeset viewer.