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.88 2008/08/26 16:18:03 grubba Exp $ + || $Id: block_alloc.h,v 1.89 2008/08/27 20:52:35 grubba Exp $   */      #undef PRE_INIT_BLOCK   #undef DO_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
pike.git/src/block_alloc.h:270:    dmalloc_accept_leak (blk); \    } \    else { \    /* Mark meta-block as available, since libc will mess with it. */ \    PIKE_MEM_RW (blk->x); \    free ((char *) blk); \    } \   } \   ) \    \ - void PIKE_CONCAT(really_free_,DATA)(struct DATA *d) \ + BA_STATIC BA_INLINE \ + void BA_UL(PIKE_CONCAT(really_free_,DATA))(struct DATA *d) \   { \    struct PIKE_CONCAT(DATA,_block) *blk; \    \    EXIT_BLOCK(d); \    \ -  DO_IF_RUN_UNLOCKED(mt_lock(&PIKE_CONCAT(DATA,_mutex))); \ -  \ +     DO_IF_DMALLOC({ \    blk = PIKE_CONCAT(DATA,_free_blocks); \    if(blk == NULL || (char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE))) { \    blk = PIKE_CONCAT(DATA,_blocks); \    while (blk && ((char *)d < (char *)blk || \    (char *)d >= (char *)(blk->x+(BSIZE)))) \    blk = blk->next; \    } \    if (blk) { \
pike.git/src/block_alloc.h:403:    blk, "in block expected to be empty") \    ); \    DO_IF_NOT_DMALLOC( \    /* Mark meta-block as available, since libc will mess with it. */ \    PIKE_MEM_RW(*blk); \    free(blk); \    ); \    \    --PIKE_CONCAT3(num_empty_,DATA,_blocks); \    } \ + } \    \ -  + DO_IF_RUN_UNLOCKED( \ +  void PIKE_CONCAT(really_free_,DATA)(struct DATA *d) \ + { \ +  DO_IF_RUN_UNLOCKED(mt_lock(&PIKE_CONCAT(DATA,_mutex))); \ +  BA_UL(PIKE_CONCAT(really_free_,DATA))(d); \    DO_IF_RUN_UNLOCKED(mt_unlock(&PIKE_CONCAT(DATA,_mutex))); \ - } \ + }) \    \   static void PIKE_CONCAT3(free_all_,DATA,_blocks_unlocked)(void) \   { \    struct PIKE_CONCAT(DATA,_block) *tmp; \    \    DO_IF_DMALLOC( \    DO_IF_BLOCK_BACKLOG ( \    MEMSET(PIKE_CONCAT(DATA,s_to_free), 0, \    sizeof(PIKE_CONCAT(DATA,s_to_free))); \    ); \