diff src/elhash.c @ 4117:229bd619740a

[xemacs-hg @ 2007-08-15 11:06:02 by crestani] 2007-08-15 Marcus Crestani <crestani@xemacs.org> * buffer.c (Fkill_buffer): * console-tty.c (free_tty_console_struct): * device-gtk.c (free_gtk_device_struct): * device-msw.c (mswindows_delete_device): * device-msw.c (msprinter_delete_device): * device-x.c (free_x_device_struct): * device-x.c (x_delete_device): * dynarr.c (Dynarr_lisp_realloc): * dynarr.c (Dynarr_free): * elhash.c: * elhash.c (finalize_hash_table): * elhash.c (resize_hash_table): * elhash.c (pdump_reorganize_hash_table): * extents.c (gap_array_delete_marker): * frame-gtk.c (gtk_delete_frame): * frame-msw.c (mswindows_delete_frame): * frame-x.c (x_delete_frame): * glyphs.c (check_for_ignored_expose): * mc-alloc.c (mc_realloc_1): * mc-alloc.h: * objects-tty.c (tty_finalize_color_instance): * objects-tty.c (tty_finalize_font_instance): * objects-tty.c (console_type_create_objects_tty): * syntax.c: * syntax.c (uninit_buffer_syntax_cache): * vdb.c (Ftest_vdb): Remove all calls to mc_free.
author crestani
date Wed, 15 Aug 2007 11:06:10 +0000
parents aa28d959af41
children 479443c0f95a
line wrap: on
line diff
--- a/src/elhash.c	Tue Aug 14 21:51:16 2007 +0000
+++ b/src/elhash.c	Wed Aug 15 11:06:10 2007 +0000
@@ -398,28 +398,16 @@
     write_fmt_string (printcharfun, " 0x%x>", ht->header.uid);
 }
 
+#ifndef NEW_GC
 static void
-free_hentries (
-#if defined (NEW_GC) && !defined (ERROR_CHECK_STRUCTURES)
-	       htentry *UNUSED (hentries),
-#else
-	       htentry *hentries,
-#endif
+free_hentries (htentry *hentries,
 #ifdef ERROR_CHECK_STRUCTURES
 	       size_t size
-#else /* not (NEW_GC && ! ERROR_CHECK_STRUCTURES) */
+#else /* not ERROR_CHECK_STRUCTURES) */
 	       size_t UNUSED (size)
-#endif /* not (NEW_GC && ! ERROR_CHECK_STRUCTURES) */
+#endif /* not ERROR_CHECK_STRUCTURES) */
 	       )
 {
-#ifdef NEW_GC
-#ifdef ERROR_CHECK_STRUCTURES
-  htentry *e, *sentinel;
-
-  for (e = hentries, sentinel = e + size; e < sentinel; e++)
-    mc_free (e);
-#endif
-#else /* not NEW_GC */
 #ifdef ERROR_CHECK_STRUCTURES
   /* Ensure a crash if other code uses the discarded entries afterwards. */
   htentry *e, *sentinel;
@@ -430,10 +418,8 @@
 
   if (!DUMPEDP (hentries))
     xfree (hentries, htentry *);
-#endif /* not NEW_GC */
 }
 
-#ifndef NEW_GC
 static void
 finalize_hash_table (void *header, int for_disksave)
 {
@@ -1071,7 +1057,9 @@
 	*probe = *e;
       }
 
+#ifndef NEW_GC
   free_hentries (old_entries, old_size);
+#endif /* not NEW_GC */
 }
 
 /* After a hash table has been saved to disk and later restored by the
@@ -1101,9 +1089,7 @@
 
   memcpy (ht->hentries, new_entries, ht->size * sizeof (htentry));
 
-#ifdef NEW_GC
-  mc_free (new_entries);
-#else /* not NEW_GC */
+#ifndef NEW_GC
   xfree (new_entries, htentry *);
 #endif /* not NEW_GC */
 }