comparison src/alloc.c @ 55634:d3542bbadad7

(mark_object): Ignore Lisp_Misc_Free objects. Such objects may be freed markers which still exist on an undo list.
author Kim F. Storm <storm@cua.dk>
date Mon, 17 May 2004 12:08:02 +0000
parents e4e9ec547c6f
children 333119854d83
comparison
equal deleted inserted replaced
55633:e01abd0ad603 55634:d3542bbadad7
842 /* Put on free list. */ 842 /* Put on free list. */
843 ablock->x.next_free = free_ablock; 843 ablock->x.next_free = free_ablock;
844 free_ablock = ablock; 844 free_ablock = ablock;
845 /* Update busy count. */ 845 /* Update busy count. */
846 ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase)); 846 ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase));
847 847
848 if (2 > (long) ABLOCKS_BUSY (abase)) 848 if (2 > (long) ABLOCKS_BUSY (abase))
849 { /* All the blocks are free. */ 849 { /* All the blocks are free. */
850 int i = 0, aligned = (long) ABLOCKS_BUSY (abase); 850 int i = 0, aligned = (long) ABLOCKS_BUSY (abase);
851 struct ablock **tem = &free_ablock; 851 struct ablock **tem = &free_ablock;
852 struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1]; 852 struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1];
4974 } 4974 }
4975 } 4975 }
4976 break; 4976 break;
4977 4977
4978 case Lisp_Misc: 4978 case Lisp_Misc:
4979 if (XMISCTYPE (obj) == Lisp_Misc_Free)
4980 {
4981 /* This is (probably) a freed marker which may still exist on
4982 a buffer undo list, so accept it here. */
4983 /* If we reuse the marker, and it still exists on the undo
4984 list, and we do undo, behaviour is unpredictable --
4985 but at least we don't crash here. KFS 2004-05-17 */
4986 break;
4987 }
4979 CHECK_ALLOCATED_AND_LIVE (live_misc_p); 4988 CHECK_ALLOCATED_AND_LIVE (live_misc_p);
4980 if (XMARKER (obj)->gcmarkbit) 4989 if (XMARKER (obj)->gcmarkbit)
4981 break; 4990 break;
4982 XMARKER (obj)->gcmarkbit = 1; 4991 XMARKER (obj)->gcmarkbit = 1;
4983 switch (XMISCTYPE (obj)) 4992 switch (XMISCTYPE (obj))