]> code.delx.au - gnu-emacs/commitdiff
(mark_fringe_data): Declare extern.
authorKim F. Storm <storm@cua.dk>
Thu, 6 Jan 2005 22:02:32 +0000 (22:02 +0000)
committerKim F. Storm <storm@cua.dk>
Thu, 6 Jan 2005 22:02:32 +0000 (22:02 +0000)
(Fgarbage_collect): Call mark_fringe_data.

(overrun_check_free): Invalidate freed memory if
XMALLOC_CLEAR_FREE_MEMORY is defined.

src/alloc.c

index 3723f9ea872cc86b681c61893f7074eda866f210..57ffd0b0ed9dbf47cfb37385cdab4861565d4647 100644 (file)
@@ -309,6 +309,7 @@ static void mark_glyph_matrix P_ ((struct glyph_matrix *));
 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 @@ overrun_check_free (block)
                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);
@@ -4799,6 +4805,10 @@ returns nil, because real GC can't be done.  */)
     }
   mark_backtrace ();
 
+#ifdef HAVE_WINDOW_SYSTEM
+  mark_fringe_data ();
+#endif
+
 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
   mark_stack ();
 #endif