Mercurial > emacs
comparison src/alloc.c @ 59400:eeb8b96d077d
(mark_fringe_data): Declare extern.
(Fgarbage_collect): Call mark_fringe_data.
(overrun_check_free): Invalidate freed memory if
XMALLOC_CLEAR_FREE_MEMORY is defined.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Thu, 06 Jan 2005 22:02:32 +0000 |
parents | 1678d14c4109 |
children | f3aa25eacdb3 cb67264d6096 |
comparison
equal
deleted
inserted
replaced
59399:643d850694b5 | 59400:eeb8b96d077d |
---|---|
307 static void gc_sweep P_ ((void)); | 307 static void gc_sweep P_ ((void)); |
308 static void mark_glyph_matrix P_ ((struct glyph_matrix *)); | 308 static void mark_glyph_matrix P_ ((struct glyph_matrix *)); |
309 static void mark_face_cache P_ ((struct face_cache *)); | 309 static void mark_face_cache P_ ((struct face_cache *)); |
310 | 310 |
311 #ifdef HAVE_WINDOW_SYSTEM | 311 #ifdef HAVE_WINDOW_SYSTEM |
312 extern void mark_fringe_data P_ ((void)); | |
312 static void mark_image P_ ((struct image *)); | 313 static void mark_image P_ ((struct image *)); |
313 static void mark_image_cache P_ ((struct frame *)); | 314 static void mark_image_cache P_ ((struct frame *)); |
314 #endif /* HAVE_WINDOW_SYSTEM */ | 315 #endif /* HAVE_WINDOW_SYSTEM */ |
315 | 316 |
316 static struct Lisp_String *allocate_string P_ ((void)); | 317 static struct Lisp_String *allocate_string P_ ((void)); |
702 size_t osize = XMALLOC_GET_SIZE (val); | 703 size_t osize = XMALLOC_GET_SIZE (val); |
703 if (bcmp (xmalloc_overrun_check_trailer, | 704 if (bcmp (xmalloc_overrun_check_trailer, |
704 val + osize, | 705 val + osize, |
705 XMALLOC_OVERRUN_CHECK_SIZE)) | 706 XMALLOC_OVERRUN_CHECK_SIZE)) |
706 abort (); | 707 abort (); |
708 #ifdef XMALLOC_CLEAR_FREE_MEMORY | |
709 val -= XMALLOC_OVERRUN_CHECK_SIZE; | |
710 memset (val, 0xff, osize + XMALLOC_OVERRUN_CHECK_SIZE*2); | |
711 #else | |
707 bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); | 712 bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); |
708 val -= XMALLOC_OVERRUN_CHECK_SIZE; | 713 val -= XMALLOC_OVERRUN_CHECK_SIZE; |
709 bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); | 714 bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); |
715 #endif | |
710 } | 716 } |
711 | 717 |
712 free (val); | 718 free (val); |
713 --check_depth; | 719 --check_depth; |
714 } | 720 } |
4796 { | 4802 { |
4797 mark_object (handler->handler); | 4803 mark_object (handler->handler); |
4798 mark_object (handler->var); | 4804 mark_object (handler->var); |
4799 } | 4805 } |
4800 mark_backtrace (); | 4806 mark_backtrace (); |
4807 | |
4808 #ifdef HAVE_WINDOW_SYSTEM | |
4809 mark_fringe_data (); | |
4810 #endif | |
4801 | 4811 |
4802 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES | 4812 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES |
4803 mark_stack (); | 4813 mark_stack (); |
4804 #endif | 4814 #endif |
4805 | 4815 |