Changeset 2745 for trunk/src/kmk


Ignore:
Timestamp:
Jan 3, 2015, 8:32:00 PM (11 years ago)
Author:
bird
Message:

Some heap stats stuff.

Location:
trunk/src/kmk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/hash.c

    r2591 r2745  
    2222
    2323
    24 #define CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))
     24/*#define       CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))*/
     25#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
    2526#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
    2627#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
  • trunk/src/kmk/incdep.c

    r2744 r2745  
    256256
    257257#if 0
    258 /* memset(malloc(sz),'\0',sz) wrapper. */
     258/* cmalloc wrapper */
    259259static void *
    260260incdep_xcalloc (struct incdep *cur, size_t size)
  • trunk/src/kmk/make.h

    r2633 r2745  
    214214# ifdef __APPLE__
    215215#  include <malloc/malloc.h>
    216 #  define SIZE_OF_HEAP_BLOCK(ptr)   malloc_good_size(ptr)
     216#  define SIZE_OF_HEAP_BLOCK(ptr)   malloc_size(ptr)
    217217
    218218# elif defined(__linux__) /* glibc */
  • trunk/src/kmk/misc.c

    r2591 r2745  
    455455  if (result == 0)
    456456    fatal (NILF, _("virtual memory exhausted"));
     457
     458#ifdef CONFIG_WITH_MAKE_STATS
     459  make_stats_allocations++;
     460  if (make_expensive_statistics)
     461    make_stats_allocated += SIZE_OF_HEAP_BLOCK (result);
     462  else
     463    make_stats_allocated += size;
     464#endif
    457465  return result;
    458466}
Note: See TracChangeset for help on using the changeset viewer.