[Top][All Lists]
[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: |
Mon, 21 Jun 2004 18:35:14 -0400 |
Index: emacs/src/lisp.h
diff -c emacs/src/lisp.h:1.497 emacs/src/lisp.h:1.498
*** emacs/src/lisp.h:1.497 Mon Jun 21 21:51:18 2004
--- emacs/src/lisp.h Mon Jun 21 22:35:29 2004
***************
*** 3256,3261 ****
--- 3256,3263 ----
#define USE_SAFE_ALLOCA \
int sa_count = SPECPDL_INDEX ()
+ /* SAFE_ALLOCA allocates a simple buffer. */
+
#define SAFE_ALLOCA(buf, type, size) \
do { \
if ((size) < MAX_ALLOCA) \
***************
*** 3268,3273 ****
--- 3270,3293 ----
} \
} 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) \
do { \
if ((size) >= MAX_ALLOCA) \