diff src/alloc.c @ 90072:cb67264d6096

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-2 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-83 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-84 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-3 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-4 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-5 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-6 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-11 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-12 Remove "-face" suffix from lazy-highlight face name * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-13 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-16 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-18 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-21 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-22 <no summary provided> * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-23 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-39 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-40 Fix regressions from latest reftex update * miles@gnu.org--gnu-2005/gnus--rel--5.10--base-0 tag of miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-1 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-2 Merge from miles@gnu.org--gnu-2004 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-3 Merge from emacs--cvs-trunk--0
author Miles Bader <miles@gnu.org>
date Sun, 16 Jan 2005 03:40:12 +0000
parents 95879cc1ed20 eeb8b96d077d
children 6d92d69fae33
line wrap: on
line diff
--- a/src/alloc.c	Sun Jan 02 09:21:32 2005 +0000
+++ b/src/alloc.c	Sun Jan 16 03:40:12 2005 +0000
@@ -103,7 +103,7 @@
    that the backend handles concurrent access to malloc within its own threads
    but Emacs code running in the main thread is not included in that control).
 
-   When UNBLOCK_INPUT is called, revoke_input_signal may be called.  If this
+   When UNBLOCK_INPUT is called, reinvoke_input_signal may be called.  If this
    happens in one of the backend threads we will have two threads that tries
    to run Emacs code at once, and the code is not prepared for that.
    To prevent that, we only call BLOCK/UNBLOCK from the main thread.  */
@@ -309,6 +309,7 @@
 static void mark_face_cache P_ ((struct face_cache *));
 
 #ifdef HAVE_WINDOW_SYSTEM
+extern void mark_fringe_data P_ ((void));
 static void mark_image P_ ((struct image *));
 static void mark_image_cache P_ ((struct frame *));
 #endif /* HAVE_WINDOW_SYSTEM */
@@ -704,9 +705,14 @@
 		val + osize,
 		XMALLOC_OVERRUN_CHECK_SIZE))
 	abort ();
+#ifdef XMALLOC_CLEAR_FREE_MEMORY
+      val -= XMALLOC_OVERRUN_CHECK_SIZE;
+      memset (val, 0xff, osize + XMALLOC_OVERRUN_CHECK_SIZE*2);
+#else
       bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE);
       val -= XMALLOC_OVERRUN_CHECK_SIZE;
       bzero (val, XMALLOC_OVERRUN_CHECK_SIZE);
+#endif
     }
 
   free (val);
@@ -1113,17 +1119,34 @@
 }
 
 
+#ifndef SYSTEM_MALLOC
+
+/* If we released our reserve (due to running out of memory),
+   and we have a fair amount free once again,
+   try to set aside another reserve in case we run out once more.
+
+   This is called when a relocatable block is freed in ralloc.c.  */
+
+void
+refill_memory_reserve ()
+{
+  if (spare_memory == 0)
+    spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
+}
+
+
 /* Arranging to disable input signals while we're in malloc.
 
    This only works with GNU malloc.  To help out systems which can't
    use GNU malloc, all the calls to malloc, realloc, and free
    elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT
-   pairs; unfortunately, we have no idea what C library functions
+   pair; unfortunately, we have no idea what C library functions
    might call malloc, so we can't really protect them unless you're
    using GNU malloc.  Fortunately, most of the major operating systems
    can use GNU malloc.  */
 
-#ifndef SYSTEM_MALLOC
+#ifndef SYNC_INPUT
+
 #ifndef DOUG_LEA_MALLOC
 extern void * (*__malloc_hook) P_ ((size_t));
 extern void * (*__realloc_hook) P_ ((void *, size_t));
@@ -1182,20 +1205,6 @@
 }
 
 
-/* If we released our reserve (due to running out of memory),
-   and we have a fair amount free once again,
-   try to set aside another reserve in case we run out once more.
-
-   This is called when a relocatable block is freed in ralloc.c.  */
-
-void
-refill_memory_reserve ()
-{
-  if (spare_memory == 0)
-    spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
-}
-
-
 /* This function is the malloc hook that Emacs uses.  */
 
 static void *
@@ -1347,6 +1356,7 @@
   __realloc_hook = emacs_blocked_realloc;
 }
 
+#endif /* not SYNC_INPUT */
 #endif /* not SYSTEM_MALLOC */
 
 
@@ -4640,7 +4650,7 @@
 	   turned off in that buffer.  Calling truncate_undo_list on
 	   Qt tends to return NULL, which effectively turns undo back on.
 	   So don't call truncate_undo_list if undo_list is Qt.  */
-	if (! EQ (nextb->undo_list, Qt))
+	if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt))
 	  truncate_undo_list (nextb);
 
 	/* Shrink buffer gaps, but skip indirect and dead buffers.  */
@@ -4752,6 +4762,10 @@
     }
   mark_backtrace ();
 
+#ifdef HAVE_WINDOW_SYSTEM
+  mark_fringe_data ();
+#endif
+
 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
   mark_stack ();
 #endif