pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1: - /* $Id: block_alloc.h,v 1.14 1999/12/19 11:02:46 hubbe Exp $ */ + /* $Id: block_alloc.h,v 1.15 2000/01/27 23:13:03 hubbe Exp $ */   #undef PRE_INIT_BLOCK   #undef INIT_BLOCK   #undef EXIT_BLOCK   #undef BLOCK_ALLOC   #undef PTR_HASH_ALLOC -  + #undef COUNT_BLOCK + #undef COUNT_OTHER      #define PRE_INIT_BLOCK(X)   #define INIT_BLOCK(X)   #define EXIT_BLOCK(X) -  + #define COUNT_BLOCK(X) + #define COUNT_OTHER()      #define BLOCK_ALLOC(DATA,BSIZE) \    \   struct PIKE_CONCAT(DATA,_block) \   { \    struct PIKE_CONCAT(DATA,_block) *next; \    struct DATA x[BSIZE]; \   }; \    \   static struct PIKE_CONCAT(DATA,_block) *PIKE_CONCAT(DATA,_blocks)=0; \
pike.git/src/block_alloc.h:76:    \   void PIKE_CONCAT3(count_memory_in_,DATA,s)(INT32 *num_, INT32 *size_) \   { \    INT32 num=0, size=0; \    struct PIKE_CONCAT(DATA,_block) *tmp; \    struct DATA *tmp2; \    for(tmp=PIKE_CONCAT(DATA,_blocks);tmp;tmp=tmp->next) \    { \    num+=BSIZE; \    size+=sizeof(struct PIKE_CONCAT(DATA,_block)); \ +  COUNT_BLOCK(tmp); \    } \    for(tmp2=PIKE_CONCAT3(free_,DATA,s);tmp2; \    tmp2=tmp2->BLOCK_ALLOC_NEXT) num--; \ -  +  COUNT_OTHER(); \    *num_=num; \    *size_=size; \   }               #define PTR_HASH_ALLOC(DATA,BSIZE) \    \   BLOCK_ALLOC(DATA,BSIZE) \