changeset 56239:a446552d2240

(allocate_misc): Update total_free_markers. (free_misc): New function. (safe_alloca_unwind, free_marker): Use it.
author Kim F. Storm <storm@cua.dk>
date Thu, 24 Jun 2004 22:01:27 +0000
parents f186f03b4d6b
children 710d37addaba
files src/alloc.c
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Thu Jun 24 20:29:41 2004 +0000
+++ b/src/alloc.c	Thu Jun 24 22:01:27 2004 +0000
@@ -590,6 +590,7 @@
   p->dogc = 0;
   xfree (p->pointer);
   p->pointer = 0;
+  free_misc (arg);
   return Qnil;
 }
 
@@ -2921,17 +2922,32 @@
 	  marker_block = new;
 	  marker_block_index = 0;
 	  n_marker_blocks++;
+	  total_free_markers += MARKER_BLOCK_SIZE;
 	}
       XSETMISC (val, &marker_block->markers[marker_block_index]);
       marker_block_index++;
     }
 
+  --total_free_markers;
   consing_since_gc += sizeof (union Lisp_Misc);
   misc_objects_consed++;
   XMARKER (val)->gcmarkbit = 0;
   return val;
 }
 
+/* Free a Lisp_Misc object */
+
+void
+free_misc (misc)
+     Lisp_Object misc;
+{
+  XMISC (misc)->u_marker.type = Lisp_Misc_Free;
+  XMISC (misc)->u_free.chain = marker_free_list;
+  marker_free_list = XMISC (misc);
+
+  total_free_markers++;
+}
+
 /* Return a Lisp_Misc_Save_Value object containing POINTER and
    INTEGER.  This is used to package C values to call record_unwind_protect.
    The unwind function can get the C values back using XSAVE_VALUE.  */
@@ -2978,12 +2994,7 @@
      Lisp_Object marker;
 {
   unchain_marker (XMARKER (marker));
-
-  XMISC (marker)->u_marker.type = Lisp_Misc_Free;
-  XMISC (marker)->u_free.chain = marker_free_list;
-  marker_free_list = XMISC (marker);
-
-  total_free_markers++;
+  free_misc (marker);
 }