From b6d714e16c91368d391a45842fc080042c43fade Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Sun, 30 Mar 2003 18:15:10 +0200
Subject: [PATCH] zap_all_arrays and zap_all_mappings are no longer used by the
 cleanup code in low_exit_main.

Rev: src/array.c:1.139
Rev: src/array.h:1.46
Rev: src/mapping.c:1.164
Rev: src/mapping.h:1.49
---
 src/array.c   | 26 ++------------------------
 src/array.h   |  3 +--
 src/mapping.c | 43 ++-----------------------------------------
 src/mapping.h |  3 +--
 4 files changed, 6 insertions(+), 69 deletions(-)

diff --git a/src/array.c b/src/array.c
index 35baa4e5e6..68b662ee7c 100644
--- a/src/array.c
+++ b/src/array.c
@@ -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.c,v 1.138 2003/03/14 15:50:43 grubba Exp $
+|| $Id: array.c,v 1.139 2003/03/30 16:15:09 mast Exp $
 */
 
 #include "global.h"
@@ -25,7 +25,7 @@
 #include "bignum.h"
 #include "cyclic.h"
 
-RCSID("$Id: array.c,v 1.138 2003/03/14 15:50:43 grubba Exp $");
+RCSID("$Id: array.c,v 1.139 2003/03/30 16:15:09 mast Exp $");
 
 PMOD_EXPORT struct array empty_array=
 {
@@ -2310,28 +2310,6 @@ void debug_dump_array(struct array *a)
 #endif
 
 
-void zap_all_arrays(void)
-{
-  struct array *a,*next;
-
-  for(a=empty_array.next;a!=&empty_array;a=next)
-  {
-
-#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC)
-    if(verbose_debug_exit && a!=&empty_array &&
-       a!=&weak_empty_array && a!=&weak_shrink_empty_array)
-      describe(a);
-#endif
-    
-    add_ref(a);
-    free_svalues(ITEM(a), a->size, a->type_field);
-    a->size=0;
-
-    SET_NEXT_AND_FREE(a,free_array);
-  }
-}
-
-
 void count_memory_in_arrays(INT32 *num_, INT32 *size_)
 {
   INT32 num=0, size=0;
diff --git a/src/array.h b/src/array.h
index b18bcf7e08..0d446f6fb1 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.45 2003/01/11 00:01:20 mast Exp $
+|| $Id: array.h,v 1.46 2003/03/30 16:15:09 mast Exp $
 */
 
 #ifndef ARRAY_H
@@ -174,7 +174,6 @@ void gc_zap_ext_weak_refs_in_arrays(void);
 size_t gc_free_all_unreferenced_arrays(void);
 void debug_dump_type_field(TYPE_FIELD t);
 void debug_dump_array(struct array *a);
-void zap_all_arrays(void);
 void count_memory_in_arrays(INT32 *num_, INT32 *size_);
 PMOD_EXPORT struct array *explode_array(struct array *a, struct array *b);
 PMOD_EXPORT struct array *implode_array(struct array *a, struct array *b);
diff --git a/src/mapping.c b/src/mapping.c
index 331318cb18..85d69ee727 100644
--- a/src/mapping.c
+++ b/src/mapping.c
@@ -2,11 +2,11 @@
 || 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.c,v 1.163 2003/03/14 15:50:44 grubba Exp $
+|| $Id: mapping.c,v 1.164 2003/03/30 16:15:09 mast Exp $
 */
 
 #include "global.h"
-RCSID("$Id: mapping.c,v 1.163 2003/03/14 15:50:44 grubba Exp $");
+RCSID("$Id: mapping.c,v 1.164 2003/03/30 16:15:09 mast Exp $");
 #include "main.h"
 #include "object.h"
 #include "mapping.h"
@@ -2467,45 +2467,6 @@ void debug_dump_mapping(struct mapping *m)
 }
 #endif
 
-void zap_all_mappings(void)
-{
-  INT32 e;
-  struct keypair *k;
-  struct mapping *m,*next;
-  struct mapping_data *md;
-
-  for(m=first_mapping;m;m=next)
-  {
-    add_ref(m);
-
-#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC)
-    if(verbose_debug_exit)
-      debug_dump_mapping(m);
-#endif
-
-    md=m->data;
-    for(e=0;e<md->hashsize;e++)
-    {
-      while((k=md->hash[e]))
-      {
-	md->hash[e]=k->next;
-	free_svalue(&k->ind);
-	free_svalue(&k->val);
-	FREE_KEYPAIR(md, k);
-        md->free_list->ind.type = T_INT;
-        md->free_list->val.type = T_INT;
-      }
-    }
-    md->size=0;
-#ifdef MAPPING_SIZE_DEBUG
-    if(m->data ==md)
-      m->debug_size=0;
-#endif
-    
-    SET_NEXT_AND_FREE(m, free_mapping);
-  }
-}
-
 int mapping_is_constant(struct mapping *m,
 			struct processing *p)
 {
diff --git a/src/mapping.h b/src/mapping.h
index 72599b24cd..efdee7a9e5 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.48 2003/01/11 00:01:20 mast Exp $
+|| $Id: mapping.h,v 1.49 2003/03/30 16:15:10 mast Exp $
 */
 
 #ifndef MAPPING_H
@@ -176,7 +176,6 @@ void gc_zap_ext_weak_refs_in_mappings(void);
 size_t gc_free_all_unreferenced_mappings(void);
 void simple_describe_mapping(struct mapping *m);
 void debug_dump_mapping(struct mapping *m);
-void zap_all_mappings(void);
 int mapping_is_constant(struct mapping *m,
 			struct processing *p);
 /* Prototypes end here */
-- 
GitLab