From dbcb29a1f42de3bded3ca8d58b2d301292fe713f Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Wed, 29 Sep 2004 01:58:26 +0200
Subject: [PATCH] Enable the gc_check_zapped stuff only when rtldebug and
 cleanup-at-exit are active at the same time.

Rev: src/array.h:1.65
Rev: src/mapping.h:1.59
Rev: src/multiset.h:1.38
Rev: src/object.h:1.88
Rev: src/program.h:1.211
---
 src/array.h    | 8 ++++----
 src/mapping.h  | 8 ++++----
 src/multiset.h | 8 ++++----
 src/object.h   | 8 ++++----
 src/program.h  | 8 ++++----
 5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/array.h b/src/array.h
index 14d75602eb..00dec73e84 100644
--- a/src/array.h
+++ b/src/array.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: array.h,v 1.64 2004/09/27 21:37:22 mast Exp $
+|| $Id: array.h,v 1.65 2004/09/28 23:58:26 mast Exp $
 */
 
 #ifndef ARRAY_H
@@ -72,9 +72,9 @@ extern struct array *gc_internal_array;
     struct array *v_=(V);						\
     debug_malloc_touch(v_);						\
     DO_IF_DEBUG (							\
-      if (gc_external_refs_zapped)					\
-	gc_check_zapped (v_, PIKE_T_ARRAY, __FILE__, __LINE__);		\
-    );									\
+      DO_IF_PIKE_CLEANUP (						\
+	if (gc_external_refs_zapped)					\
+	  gc_check_zapped (v_, PIKE_T_ARRAY, __FILE__, __LINE__)));	\
     if(!sub_ref(v_))							\
       really_free_array(v_);						\
   }while(0)
diff --git a/src/mapping.h b/src/mapping.h
index 7fe0d47f10..53a31273d6 100644
--- a/src/mapping.h
+++ b/src/mapping.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: mapping.h,v 1.58 2004/09/27 21:37:23 mast Exp $
+|| $Id: mapping.h,v 1.59 2004/09/28 23:58:26 mast Exp $
 */
 
 #ifndef MAPPING_H
@@ -91,9 +91,9 @@ extern struct mapping *gc_internal_mapping;
     struct mapping *m_=(M);						\
     debug_malloc_touch(m_);						\
     DO_IF_DEBUG (							\
-      if (gc_external_refs_zapped)					\
-	gc_check_zapped (m_, PIKE_T_MAPPING, __FILE__, __LINE__);	\
-    );									\
+      DO_IF_PIKE_CLEANUP (						\
+	if (gc_external_refs_zapped)					\
+	  gc_check_zapped (m_, PIKE_T_MAPPING, __FILE__, __LINE__)));	\
     if(!sub_ref(m_))							\
       really_free_mapping(m_);						\
   }while(0)
diff --git a/src/multiset.h b/src/multiset.h
index 8d3c4d0c48..cdcd924828 100644
--- a/src/multiset.h
+++ b/src/multiset.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: multiset.h,v 1.37 2004/09/27 21:37:23 mast Exp $
+|| $Id: multiset.h,v 1.38 2004/09/28 23:58:26 mast Exp $
 */
 
 #ifndef MULTISET_H
@@ -227,9 +227,9 @@ PMOD_PROTO void really_free_multiset (struct multiset *l);
     struct multiset *_ms_ = (L);					\
     debug_malloc_touch (_ms_);						\
     DO_IF_DEBUG (							\
-      if (gc_external_refs_zapped)					\
-	gc_check_zapped (_ms_, PIKE_T_MULTISET, __FILE__, __LINE__);	\
-    );									\
+      DO_IF_PIKE_CLEANUP (						\
+	if (gc_external_refs_zapped)					\
+	  gc_check_zapped (_ms_, PIKE_T_MULTISET, __FILE__, __LINE__))); \
     if (!sub_ref (_ms_)) really_free_multiset (_ms_);			\
   } while (0)
 
diff --git a/src/object.h b/src/object.h
index a6d5456fa3..6a5f1a36cd 100644
--- a/src/object.h
+++ b/src/object.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: object.h,v 1.87 2004/09/27 21:37:23 mast Exp $
+|| $Id: object.h,v 1.88 2004/09/28 23:58:26 mast Exp $
 */
 
 #ifndef OBJECT_H
@@ -48,9 +48,9 @@ void gc_check_zapped (void *a, TYPE_T type, const char *file, int line);
     debug_malloc_touch(o_);						\
     debug_malloc_touch(o_->storage);					\
     DO_IF_DEBUG (							\
-      if (gc_external_refs_zapped)					\
-	gc_check_zapped (o_, PIKE_T_OBJECT, __FILE__, __LINE__);	\
-    );									\
+      DO_IF_PIKE_CLEANUP (						\
+	if (gc_external_refs_zapped)					\
+	  gc_check_zapped (o_, PIKE_T_OBJECT, __FILE__, __LINE__)));	\
     if(!sub_ref(o_))							\
       schedule_really_free_object(o_);					\
   }while(0)
diff --git a/src/program.h b/src/program.h
index d22f6a446f..664796a3cf 100644
--- a/src/program.h
+++ b/src/program.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: program.h,v 1.210 2004/09/27 21:37:23 mast Exp $
+|| $Id: program.h,v 1.211 2004/09/28 23:58:26 mast Exp $
 */
 
 #ifndef PROGRAM_H
@@ -575,9 +575,9 @@ void gc_check_zapped (void *a, TYPE_T type, const char *file, int line);
     struct program *_=(p);						\
     debug_malloc_touch(_);						\
     DO_IF_DEBUG (							\
-      if (gc_external_refs_zapped)					\
-	gc_check_zapped (_, PIKE_T_PROGRAM, __FILE__, __LINE__);	\
-    );									\
+      DO_IF_PIKE_CLEANUP (						\
+	if (gc_external_refs_zapped)					\
+	  gc_check_zapped (_, PIKE_T_PROGRAM, __FILE__, __LINE__)));	\
     if(!sub_ref(_))							\
       really_free_program(_);						\
   }while(0)
-- 
GitLab