pike.git / src / block_alloc.h

version» Context lines:

pike.git/src/block_alloc.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: block_alloc.h,v 1.49 2002/11/20 17:33:42 grubba Exp $ + || $Id: block_alloc.h,v 1.50 2002/11/20 18:02:05 grubba 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
pike.git/src/block_alloc.h:138:    } \    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) \   { \    struct PIKE_CONCAT(DATA,_block) *blk = PIKE_CONCAT(DATA,_free_blocks); \ +  EXIT_BLOCK(d); \    if(blk == NULL || (char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))) { \    blk = PIKE_CONCAT(DATA,_blocks); \    if((char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))) { \    do { \    blk = blk->next; \    } while((char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))); \    if(blk == PIKE_CONCAT(DATA,_free_blocks)) \
pike.git/src/block_alloc.h:160:    if(blk->next) \    blk->next->prev = blk->prev; \    blk->prev = NULL; \    blk->next = PIKE_CONCAT(DATA,_blocks); \    blk->next->prev = blk; \    PIKE_CONCAT(DATA,_blocks) = blk; \    } \    if(PIKE_CONCAT(DATA,_free_blocks) == NULL) \    PIKE_CONCAT(DATA,_free_blocks) = blk; \    } \ -  EXIT_BLOCK(d); \ +     DO_IF_DMALLOC( PIKE_CONCAT(check_free_,DATA)(d); \    dmalloc_mark_as_free(d, 1); ) \    d->BLOCK_ALLOC_NEXT = (void *)blk->PIKE_CONCAT3(free_,DATA,s); \    PRE_INIT_BLOCK(d); \    /* Mark block as unavailable. */ \    PIKE_MEM_NA(d, sizeof(*d)); \    blk->PIKE_CONCAT3(free_,DATA,s)=d; \    if(!--blk->used && \    ++PIKE_CONCAT3(num_empty_,DATA,_blocks) > MAX_EMPTY_BLOCKS) { \    if(blk == PIKE_CONCAT(DATA,_free_blocks)) { \
pike.git/src/block_alloc.h:196:   { \    struct PIKE_CONCAT(DATA,_block) *blk; \    EXIT_BLOCK(d); \    DO_IF_RUN_UNLOCKED(mt_lock(&PIKE_CONCAT(DATA,_mutex))); \    blk = PIKE_CONCAT(DATA,_free_blocks); \    if(blk == NULL || (char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))) { \    blk = PIKE_CONCAT(DATA,_blocks); \    if((char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))) { \ -  do \ +  do { \    blk = blk->next; \ -  while((char *)d < (char *)blk || \ +  } while((char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))); \    if(blk == PIKE_CONCAT(DATA,_free_blocks)) \    PIKE_CONCAT(DATA,_free_blocks) = blk->prev; \    blk->prev->next = blk->next; \    if(blk->next) \    blk->next->prev = blk->prev; \    blk->prev = NULL; \    blk->next = PIKE_CONCAT(DATA,_blocks); \    blk->next->prev = blk; \    PIKE_CONCAT(DATA,_blocks) = blk; \
pike.git/src/block_alloc.h:257:    { \    dmalloc_check_block_free(tmp->x+tmp2, DMALLOC_LOCATION()); \    dmalloc_unregister(tmp->x+tmp2, 1); \    } \    } \    ) \    while((tmp=PIKE_CONCAT(DATA,_blocks))) \    { \    PIKE_CONCAT(DATA,_blocks)=tmp->next; \    /* Mark meta-block as available, since libc will mess with it. */ \ -  PIKE_MEM_RW(tmp, sizeof(*tmp)); \ +  PIKE_MEM_RW(&tmp->x, sizeof(tmp->x)); \    free((char *)tmp); \    } \    PIKE_CONCAT(DATA,_blocks)=0; \    PIKE_CONCAT(DATA,_free_blocks)=0; \    PIKE_CONCAT3(num_empty_,DATA,_blocks)=0; \   } \    \   void PIKE_CONCAT3(free_all_,DATA,_blocks)(void) \   { \    DO_IF_RUN_UNLOCKED(mt_lock(&PIKE_CONCAT(DATA,_mutex))); \