Branch: Tag:

2008-08-27

2008-08-27 20:52:35 by Henrik Grubbström (Grubba) <grubba@grubba.org>

really_free_*_unlocked() now exists once again in UNLOCKED-mode.
Fixes several issues with UNLOCKED-mode.

Rev: src/block_alloc.h:1.89

2:   || 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
277:   } \   ) \    \ - 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 || \
410:    \    --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) \   { \