emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/lisp.h


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/lisp.h
Date: Tue, 22 Jun 2004 09:57:04 -0400

Index: emacs/src/lisp.h
diff -c emacs/src/lisp.h:1.498 emacs/src/lisp.h:1.499
*** emacs/src/lisp.h:1.498      Mon Jun 21 22:35:29 2004
--- emacs/src/lisp.h    Tue Jun 22 13:57:18 2004
***************
*** 1199,1205 ****
    {
      int type : 16;    /* = Lisp_Misc_Save_Value */
      unsigned gcmarkbit : 1;
!     int spacer : 15;
      void *pointer;
      int integer;
    };
--- 1199,1208 ----
    {
      int type : 16;    /* = Lisp_Misc_Save_Value */
      unsigned gcmarkbit : 1;
!     int spacer : 14;
!     /* If DOGC is set, POINTER is the address of a memory
!        area containing INTEGER potential Lisp_Objects.  */
!     unsigned int dogc : 1;
      void *pointer;
      int integer;
    };
***************
*** 3270,3291 ****
        }                                                         \
    } while (0)
  
- /* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects.
-    Temporarily inhibits GC since that array is unknow to GC.  */
- 
- #define SAFE_ALLOCA_LISP(buf, size)                     \
-   do {                                                          \
-     if ((size) < MAX_ALLOCA)                            \
-       buf = (Lisp_Object *) alloca (size);              \
-     else                                                \
-       {                                                         \
-       buf = (Lisp_Object *) xmalloc (size);             \
-       inhibit_garbage_collection();                     \
-       record_unwind_protect (safe_alloca_unwind,        \
-                              make_save_value (buf, 0)); \
-       }                                                         \
-   } while (0)
- 
  /* SAFE_FREE frees xmalloced memory and enables GC as needed.  */
  
  #define SAFE_FREE(size)                       \
--- 3273,3278 ----
***************
*** 3295,3300 ****
--- 3282,3310 ----
    } while (0)
  
  
+ /* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects.  */
+ 
+ #define SAFE_ALLOCA_LISP(buf, nelt)                     \
+   do {                                                          \
+     int size_ = (nelt) * sizeof (Lisp_Object);                  \
+     if (size_ < MAX_ALLOCA)                             \
+       buf = (Lisp_Object *) alloca (size_);             \
+     else                                                \
+       {                                                         \
+       Lisp_Object arg_;                                 \
+       buf = (Lisp_Object *) xmalloc (size_);            \
+       arg_ = make_save_value (buf, nelt);               \
+       XSAVE_VALUE (arg_)->dogc = 1;                     \
+       record_unwind_protect (safe_alloca_unwind, arg_); \
+       }                                                         \
+   } while (0)
+ 
+ #define SAFE_FREE_LISP(nelt)                          \
+   do {                                                        \
+     if (((nelt) * sizeof (Lisp_Object)) >= MAX_ALLOCA)        \
+       unbind_to (sa_count, Qnil);                     \
+   } while (0)
+ 
  
  
  #endif /* EMACS_LISP_H */




reply via email to

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