pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:73:      #include "block_allocator.h"      #define LOW_PTR_HASH_ALLOC(DATA,BSIZE) \    \   static struct block_allocator PIKE_CONCAT(DATA,_allocator) = \    BA_INIT(sizeof(struct DATA), BSIZE); \    \   struct DATA *PIKE_CONCAT(alloc_,DATA)(void) { \    struct DATA * ptr = (struct DATA *)ba_alloc(&PIKE_CONCAT(DATA,_allocator));\ +  DO_IF_DMALLOC( \ +  dmalloc_register(ptr, sizeof(struct DATA), \ +  DMALLOC_NAMED_LOCATION(TOSTR(DATA))) \ +  ); \    INIT_BLOCK(ptr); \    return ptr; \   } \    \   void PIKE_CONCAT(really_free_,DATA)(struct DATA *d) { \    EXIT_BLOCK(d); \ -  +  DO_IF_DMALLOC( \ +  dmalloc_unregister(d, 0) \ +  ); \    ba_free(&PIKE_CONCAT(DATA,_allocator), d); \   } \    \   void PIKE_CONCAT3(count_memory_in_,DATA,s)(size_t *num_, size_t *size_) { \    ba_count_all(&PIKE_CONCAT(DATA,_allocator), num_, size_); \   } \    \   struct DATA **PIKE_CONCAT(DATA,_hash_table)=0; \   size_t PIKE_CONCAT(DATA,_hash_table_size)=0; \   static size_t PIKE_CONCAT(num_,DATA)=0; \
pike.git/src/block_alloc.h:223:    memset(PIKE_CONCAT(DATA,_hash_table),0, \    sizeof(struct DATA *)*PIKE_CONCAT(DATA,_hash_table_size)); \   } \    \    \   static void PIKE_UNUSED_ATTRIBUTE PIKE_CONCAT3(init_,DATA,_hash)(void) \   { \    PIKE_CONCAT3(low_init_,DATA,_hash)(BSIZE); \   } \    \ - static void PIKE_CONCAT3(exit_,DATA,_hash)(void) \ + static void PIKE_CONCAT3(exit_,DATA,_hash)(void) \   { \ -  +  DO_IF_DMALLOC(dmalloc_unregister_all(& PIKE_CONCAT(DATA,_allocator))); \    ba_free_all(& PIKE_CONCAT(DATA,_allocator)); \    free(PIKE_CONCAT(DATA,_hash_table)); \    PIKE_CONCAT(DATA,_hash_table)=0; \    PIKE_CONCAT(num_,DATA)=0; \   }      #define PTR_HASH_ALLOC_FIXED(DATA,BSIZE) \   static struct DATA *PIKE_CONCAT3(make_,DATA,_unlocked)(void *ptr, PIKE_HASH_T hval);\   LOW_PTR_HASH_ALLOC(DATA,BSIZE) \    \