emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/alloc.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/alloc.c [lexbind]
Date: Tue, 06 Jul 2004 07:00:37 -0400

Index: emacs/src/alloc.c
diff -c emacs/src/alloc.c:1.272.2.9 emacs/src/alloc.c:1.272.2.10
*** emacs/src/alloc.c:1.272.2.9 Tue Jul  6 09:31:27 2004
--- emacs/src/alloc.c   Tue Jul  6 10:20:19 2004
***************
*** 579,584 ****
--- 579,599 ----
  }
  
  
+ /* 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,2940 ****
--- 2950,2956 ----
    p = XSAVE_VALUE (val);
    p->pointer = pointer;
    p->integer = integer;
+   p->dogc = 0;
    return val;
  }
  
***************
*** 4968,4973 ****
--- 4984,4990 ----
        if (XMARKER (obj)->gcmarkbit)
        break;
        XMARKER (obj)->gcmarkbit = 1;
+ 
        switch (XMISCTYPE (obj))
        {
        case Lisp_Misc_Buffer_Local_Value:
***************
*** 4992,4997 ****
--- 5009,5016 ----
          /* 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:
***************
*** 5001,5007 ****
--- 5020,5040 ----
             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:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]