diff options
author | Kim F. Storm <storm@cua.dk> | 2004-06-22 13:56:34 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2004-06-22 13:56:34 +0000 |
commit | b766f87064147ba0feaa62de26ed8d1ed46ad96a (patch) | |
tree | 4c93091f59fc97f24ffbf542f1b8a5bf841e6fbc | |
parent | ef54b2d09b43983c17591218be14f5bd8e0850ed (diff) | |
download | emacs-b766f87064147ba0feaa62de26ed8d1ed46ad96a.tar.gz |
(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.
-rw-r--r-- | src/alloc.c | 24 |
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 safe_alloca_unwind (arg) Lisp_Object arg; { - xfree (XSAVE_VALUE (arg)->pointer); + register struct Lisp_Save_Value *p = XSAVE_VALUE (arg); + + p->dogc = 0; + xfree (p->pointer); + p->pointer = 0; return Qnil; } @@ -2945,6 +2949,7 @@ make_save_value (pointer, integer) p = XSAVE_VALUE (val); p->pointer = pointer; p->integer = integer; + p->dogc = 0; return val; } @@ -4978,6 +4983,7 @@ mark_object (arg) if (XMARKER (obj)->gcmarkbit) break; XMARKER (obj)->gcmarkbit = 1; + switch (XMISCTYPE (obj)) { case Lisp_Misc_Buffer_Local_Value: @@ -5002,6 +5008,8 @@ mark_object (arg) /* DO NOT mark thru the marker's chain. The buffer's markers chain does not preserve markers from gc; instead, markers are removed from the chain when freed by gc. */ + break; + case Lisp_Misc_Intfwd: case Lisp_Misc_Boolfwd: case Lisp_Misc_Objfwd: @@ -5011,7 +5019,21 @@ mark_object (arg) since all markable slots in current buffer marked anyway. */ /* Don't need to do Lisp_Objfwd, since the places they point are protected with staticpro. */ + break; + case Lisp_Misc_Save_Value: + { + register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); + /* If DOGC is set, POINTER is the address of a memory + area containing INTEGER potential Lisp_Objects. */ + if (ptr->dogc) + { + Lisp_Object *p = (Lisp_Object *) ptr->pointer; + int nelt; + for (nelt = ptr->integer; nelt > 0; nelt--, p++) + mark_maybe_object (*p); + } + } break; case Lisp_Misc_Overlay: |