aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorKaroly Lorentey <[email protected]>2004-06-24 07:44:13 +0000
committerKaroly Lorentey <[email protected]>2004-06-24 07:44:13 +0000
commit3fa701994755105d1fb4b0b802338fc04e8a6937 (patch)
tree02ec9152f5f6e95bbb0b02265f51b832e712e8b5 /src/alloc.c
parent8c8d5f3503a2fb4918414c0b0b9dacd81c50f1a9 (diff)
parentbb72b9d0b5248404a55b599d99c0be5454704e4a (diff)
Merged in changes from CVS trunk.
Patches applied: * [email protected]/emacs--cvs-trunk--0--patch-409 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-410 Make sure image types are initialized for lookup too * [email protected]/emacs--cvs-trunk--0--patch-411 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-412 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-413 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-414 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-415 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-416 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-417 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-418 Update from CVS * [email protected]/emacs--cvs-trunk--0--patch-419 Update from CVS git-archimport-id: [email protected]/emacs--multi-tty--0--patch-202
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 3a3628f40f..baf7afa009 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -580,6 +580,21 @@ xstrdup (s)
}
+/* Unwind for SAFE_ALLOCA */
+
+Lisp_Object
+safe_alloca_unwind (arg)
+ Lisp_Object arg;
+{
+ register struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
+
+ p->dogc = 0;
+ xfree (p->pointer);
+ p->pointer = 0;
+ return Qnil;
+}
+
+
/* Like malloc but used for allocating Lisp data. NBYTES is the
number of bytes to allocate, TYPE describes the intended use of the
allcated memory block (for strings, for conses, ...). */
@@ -2935,6 +2950,7 @@ make_save_value (pointer, integer)
p = XSAVE_VALUE (val);
p->pointer = pointer;
p->integer = integer;
+ p->dogc = 0;
return val;
}
@@ -4969,6 +4985,7 @@ mark_object (arg)
if (XMARKER (obj)->gcmarkbit)
break;
XMARKER (obj)->gcmarkbit = 1;
+
switch (XMISCTYPE (obj))
{
case Lisp_Misc_Buffer_Local_Value:
@@ -4993,6 +5010,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:
@@ -5002,7 +5021,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: