pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1: - /* $Id: block_alloc.h,v 1.40 2001/11/08 23:34:27 nilsson Exp $ */ + /* $Id: block_alloc.h,v 1.41 2002/08/15 14:49:19 marcus Exp $ */   #undef PRE_INIT_BLOCK   #undef INIT_BLOCK   #undef EXIT_BLOCK   #undef BLOCK_ALLOC   #undef LOW_PTR_HASH_ALLOC   #undef PTR_HASH_ALLOC_FIXED   #undef PTR_HASH_ALLOC   #undef COUNT_BLOCK   #undef COUNT_OTHER   #undef BLOCK_ALLOC_HSIZE_SHIFT
pike.git/src/block_alloc.h:64:    } \   } \    \   BA_STATIC BA_INLINE struct DATA *BA_UL(PIKE_CONCAT(alloc_,DATA))(void) \   { \    struct DATA *tmp; \    if(!PIKE_CONCAT3(free_,DATA,s)) \    PIKE_CONCAT(alloc_more_,DATA)(); \    DO_IF_DEBUG( \    else if (PIKE_CONCAT3(free_,DATA,s) == (struct DATA *)-1) \ -  fatal("Block alloc not initialized.\n"); \ +  Pike_fatal("Block alloc not initialized.\n"); \    ) \    \    tmp=PIKE_CONCAT3(free_,DATA,s); \    PIKE_CONCAT3(free_,DATA,s)=(struct DATA *)tmp->BLOCK_ALLOC_NEXT; \    DO_IF_DMALLOC( \    dmalloc_unregister(tmp, 1); \    dmalloc_register(tmp,sizeof(struct DATA), DMALLOC_LOCATION()); \    ) \    INIT_BLOCK(tmp); \    return tmp; \
pike.git/src/block_alloc.h:97:   DO_IF_DMALLOC( \   static void PIKE_CONCAT(check_free_,DATA)(struct DATA *d) \   { \    struct PIKE_CONCAT(DATA,_block) *tmp; \    for(tmp=PIKE_CONCAT(DATA,_blocks);tmp;tmp=tmp->next) \    { \    if( (char *)d < (char *)tmp) continue; \    if( (char *)d >= (char *)(tmp->x+BSIZE)) continue; \    return; \    } \ -  fatal("really_free_%s called on non-block_alloc region (%p).\n", \ +  Pike_fatal("really_free_%s called on non-block_alloc region (%p).\n", \    #DATA, d); \   } \   ) \    \   DO_IF_RUN_UNLOCKED( \   void PIKE_CONCAT3(really_free_,DATA,_unlocked)(struct DATA *d) \   { \    EXIT_BLOCK(d); \    DO_IF_DMALLOC( PIKE_CONCAT(check_free_,DATA)(d); \    dmalloc_mark_as_free(d, 1); ) \
pike.git/src/block_alloc.h:288:    if(!PIKE_CONCAT(DATA,_hash_table)) \    { \    DO_IF_RUN_UNLOCKED(mt_unlock(&PIKE_CONCAT(DATA,_mutex))); \    return 0; \    } \    hval%=PIKE_CONCAT(DATA,_hash_table_size); \    if((p=PIKE_CONCAT3(really_low_find_,DATA,_unlocked)(ptr, hval))) \    { \    PIKE_CONCAT(num_,DATA)--; \    DO_IF_DEBUG( if(PIKE_CONCAT(DATA,_hash_table)[hval]!=p) \ -  fatal("GAOssdf\n"); ); \ +  Pike_fatal("GAOssdf\n"); ); \    PIKE_CONCAT(DATA,_hash_table)[hval]=p->BLOCK_ALLOC_NEXT; \    BA_UL(PIKE_CONCAT(really_free_,DATA))(p); \    DO_IF_RUN_UNLOCKED(mt_unlock(&PIKE_CONCAT(DATA,_mutex))); \    return 1; \    } \    DO_IF_RUN_UNLOCKED(mt_unlock(&PIKE_CONCAT(DATA,_mutex))); \    return 0; \   } \    \   void PIKE_CONCAT3(low_init_,DATA,_hash)(size_t size) \
pike.git/src/block_alloc.h:344:      #define PTR_HASH_ALLOC_FIXED(DATA,BSIZE) \   struct DATA *PIKE_CONCAT3(make_,DATA,_unlocked)(void *ptr, size_t hval); \   LOW_PTR_HASH_ALLOC(DATA,BSIZE) \    \   struct DATA *PIKE_CONCAT3(make_,DATA,_unlocked)(void *ptr, size_t hval) \   { \    struct DATA *p; \    \    DO_IF_DEBUG( if(!PIKE_CONCAT(DATA,_hash_table)) \ -  fatal("Hash table error!\n"); ) \ +  Pike_fatal("Hash table error!\n"); ) \    PIKE_CONCAT(num_,DATA)++; \    \    p=BA_UL(PIKE_CONCAT(alloc_,DATA))(); \    p->data=ptr; \    p->BLOCK_ALLOC_NEXT=PIKE_CONCAT(DATA,_hash_table)[hval]; \    PIKE_CONCAT(DATA,_hash_table)[hval]=p; \    return p; \   } \      
pike.git/src/block_alloc.h:403:    PIKE_CONCAT(DATA,_hash_table)=old_hash; \    PIKE_CONCAT(DATA,_hash_table_size)=e; \    } \   } \    \   struct DATA *PIKE_CONCAT3(make_,DATA,_unlocked)(void *ptr, size_t hval) \   { \    struct DATA *p; \    \    DO_IF_DEBUG( if(!PIKE_CONCAT(DATA,_hash_table)) \ -  fatal("Hash table error!\n"); ) \ +  Pike_fatal("Hash table error!\n"); ) \    PIKE_CONCAT(num_,DATA)++; \    \    if(( PIKE_CONCAT(num_,DATA)>>BLOCK_ALLOC_HSIZE_SHIFT ) >= \    PIKE_CONCAT(DATA,_hash_table_size)) \    { \    PIKE_CONCAT(DATA,_rehash)(); \    hval=(size_t)ptr; \    hval%=PIKE_CONCAT(DATA,_hash_table_size); \    } \    \    p=BA_UL(PIKE_CONCAT(alloc_,DATA))(); \    p->data=ptr; \    p->BLOCK_ALLOC_NEXT=PIKE_CONCAT(DATA,_hash_table)[hval]; \    PIKE_CONCAT(DATA,_hash_table)[hval]=p; \    return p; \   }