pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1: - /* $Id: block_alloc.h,v 1.24 2000/08/24 04:04:40 hubbe Exp $ */ + /* $Id: block_alloc.h,v 1.25 2000/11/25 16:33:22 grubba 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)
pike.git/src/block_alloc.h:36:    if(!n) \    { \    fprintf(stderr,"Fatal: out of memory.\n"); \    exit(17); \    } \    n->next=PIKE_CONCAT(DATA,_blocks); \    PIKE_CONCAT(DATA,_blocks)=n; \    \    for(e=0;e<BSIZE;e++) \    { \ -  n->x[e].BLOCK_ALLOC_NEXT=PIKE_CONCAT3(free_,DATA,s); \ +  n->x[e].BLOCK_ALLOC_NEXT=(void *)PIKE_CONCAT3(free_,DATA,s); \    PRE_INIT_BLOCK( (n->x+e) ); \    PIKE_CONCAT3(free_,DATA,s)=n->x+e; \    } \    } \    \    tmp=PIKE_CONCAT3(free_,DATA,s); \ -  PIKE_CONCAT3(free_,DATA,s)=tmp->BLOCK_ALLOC_NEXT; \ +  PIKE_CONCAT3(free_,DATA,s)=(struct DATA *)tmp->BLOCK_ALLOC_NEXT; \    DO_IF_DMALLOC( dmalloc_register(tmp,sizeof(struct DATA), DMALLOC_LOCATION()); )\    INIT_BLOCK(tmp); \    return tmp; \   } \    \   void PIKE_CONCAT(really_free_,DATA)(struct DATA *d) \   { \    EXIT_BLOCK(d); \    DO_IF_DMALLOC( dmalloc_unregister(d, 1); ) \ -  d->BLOCK_ALLOC_NEXT=PIKE_CONCAT3(free_,DATA,s); \ +  d->BLOCK_ALLOC_NEXT = (void *)PIKE_CONCAT3(free_,DATA,s); \    PRE_INIT_BLOCK(d); \    PIKE_CONCAT3(free_,DATA,s)=d; \   } \    \   void PIKE_CONCAT3(free_all_,DATA,_blocks)(void) \   { \    struct PIKE_CONCAT(DATA,_block) *tmp; \    DO_IF_DMALLOC( \    for(tmp=PIKE_CONCAT(DATA,_blocks);tmp;tmp=tmp->next) \    { \
pike.git/src/block_alloc.h:92:    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--; \ +  tmp2 = (struct DATA *)tmp2->BLOCK_ALLOC_NEXT) num--; \    COUNT_OTHER(); \    *num_=num; \    *size_=size; \   }               #define PTR_HASH_ALLOC(DATA,BSIZE) \    \