From 951c16a1186c1663ee3205e7b05e82cf49922b00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 27 Aug 2008 22:52:35 +0200
Subject: [PATCH] really_free_*_unlocked() now exists once again in
 UNLOCKED-mode. Fixes several issues with UNLOCKED-mode.

Rev: src/block_alloc.h:1.89
---
 src/block_alloc.h | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/block_alloc.h b/src/block_alloc.h
index 010aa3105f..689f9d57fc 100644
--- a/src/block_alloc.h
+++ b/src/block_alloc.h
@@ -2,7 +2,7 @@
 || 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,14 +277,13 @@ static void PIKE_CONCAT3(dmalloc_free_,DATA,_block) (			\
 }									\
 )									\
 									\
-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,9 +409,15 @@ void PIKE_CONCAT(really_free_,DATA)(struct DATA *d)			\
 									\
     --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)		\
 {									\
-- 
GitLab