aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorKim F. Storm2004-06-22 13:56:34 +0000
committerKim F. Storm2004-06-22 13:56:34 +0000
commitb766f87064147ba0feaa62de26ed8d1ed46ad96a (patch)
tree4c93091f59fc97f24ffbf542f1b8a5bf841e6fbc /src/alloc.c
parentef54b2d09b43983c17591218be14f5bd8e0850ed (diff)
downloademacs-b766f87064147ba0feaa62de26ed8d1ed46ad96a.tar.gz
emacs-b766f87064147ba0feaa62de26ed8d1ed46ad96a.zip
(safe_alloca_unwind): Clear dogc and pointer members.
(make_save_value): Init new dogc member. (mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 897fe910a6e..06f7eb6174e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -585,7 +585,11 @@ Lisp_Object
585safe_alloca_unwind (arg) 585safe_alloca_unwind (arg)
586 Lisp_Object arg; 586 Lisp_Object arg;
587{ 587{
588 xfree (XSAVE_VALUE (arg)->pointer); 588 register struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
589
590 p->dogc = 0;
591 xfree (p->pointer);
592 p->pointer = 0;
589 return Qnil; 593 return Qnil;
590} 594}
591 595
@@ -2945,6 +2949,7 @@ make_save_value (pointer, integer)
2945 p = XSAVE_VALUE (val); 2949 p = XSAVE_VALUE (val);
2946 p->pointer = pointer; 2950 p->pointer = pointer;
2947 p->integer = integer; 2951 p->integer = integer;
2952 p->dogc = 0;
2948 return val; 2953 return val;
2949} 2954}
2950 2955
@@ -4978,6 +4983,7 @@ mark_object (arg)
4978 if (XMARKER (obj)->gcmarkbit) 4983 if (XMARKER (obj)->gcmarkbit)
4979 break; 4984 break;
4980 XMARKER (obj)->gcmarkbit = 1; 4985 XMARKER (obj)->gcmarkbit = 1;
4986
4981 switch (XMISCTYPE (obj)) 4987 switch (XMISCTYPE (obj))
4982 { 4988 {
4983 case Lisp_Misc_Buffer_Local_Value: 4989 case Lisp_Misc_Buffer_Local_Value:
@@ -5002,6 +5008,8 @@ mark_object (arg)
5002 /* DO NOT mark thru the marker's chain. 5008 /* DO NOT mark thru the marker's chain.
5003 The buffer's markers chain does not preserve markers from gc; 5009 The buffer's markers chain does not preserve markers from gc;
5004 instead, markers are removed from the chain when freed by gc. */ 5010 instead, markers are removed from the chain when freed by gc. */
5011 break;
5012
5005 case Lisp_Misc_Intfwd: 5013 case Lisp_Misc_Intfwd:
5006 case Lisp_Misc_Boolfwd: 5014 case Lisp_Misc_Boolfwd:
5007 case Lisp_Misc_Objfwd: 5015 case Lisp_Misc_Objfwd:
@@ -5011,7 +5019,21 @@ mark_object (arg)
5011 since all markable slots in current buffer marked anyway. */ 5019 since all markable slots in current buffer marked anyway. */
5012 /* Don't need to do Lisp_Objfwd, since the places they point 5020 /* Don't need to do Lisp_Objfwd, since the places they point
5013 are protected with staticpro. */ 5021 are protected with staticpro. */
5022 break;
5023
5014 case Lisp_Misc_Save_Value: 5024 case Lisp_Misc_Save_Value:
5025 {
5026 register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
5027 /* If DOGC is set, POINTER is the address of a memory
5028 area containing INTEGER potential Lisp_Objects. */
5029 if (ptr->dogc)
5030 {
5031 Lisp_Object *p = (Lisp_Object *) ptr->pointer;
5032 int nelt;
5033 for (nelt = ptr->integer; nelt > 0; nelt--, p++)
5034 mark_maybe_object (*p);
5035 }
5036 }
5015 break; 5037 break;
5016 5038
5017 case Lisp_Misc_Overlay: 5039 case Lisp_Misc_Overlay: