aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index dc78e524213..c6e585e0863 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3256,6 +3256,8 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3256#define USE_SAFE_ALLOCA \ 3256#define USE_SAFE_ALLOCA \
3257 int sa_count = SPECPDL_INDEX () 3257 int sa_count = SPECPDL_INDEX ()
3258 3258
3259/* SAFE_ALLOCA allocates a simple buffer. */
3260
3259#define SAFE_ALLOCA(buf, type, size) \ 3261#define SAFE_ALLOCA(buf, type, size) \
3260 do { \ 3262 do { \
3261 if ((size) < MAX_ALLOCA) \ 3263 if ((size) < MAX_ALLOCA) \
@@ -3268,6 +3270,24 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3268 } \ 3270 } \
3269 } while (0) 3271 } while (0)
3270 3272
3273/* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects.
3274 Temporarily inhibits GC since that array is unknow to GC. */
3275
3276#define SAFE_ALLOCA_LISP(buf, size) \
3277 do { \
3278 if ((size) < MAX_ALLOCA) \
3279 buf = (Lisp_Object *) alloca (size); \
3280 else \
3281 { \
3282 buf = (Lisp_Object *) xmalloc (size); \
3283 inhibit_garbage_collection(); \
3284 record_unwind_protect (safe_alloca_unwind, \
3285 make_save_value (buf, 0)); \
3286 } \
3287 } while (0)
3288
3289/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
3290
3271#define SAFE_FREE(size) \ 3291#define SAFE_FREE(size) \
3272 do { \ 3292 do { \
3273 if ((size) >= MAX_ALLOCA) \ 3293 if ((size) >= MAX_ALLOCA) \