aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorMiles Bader2004-10-27 06:03:07 +0000
committerMiles Bader2004-10-27 06:03:07 +0000
commit68c015f511f43f6d24ac79ac78cd4a7b3cd5a89e (patch)
treec03104b7ab1750759f40ce18d230093e0ea49824 /src/lisp.h
parente0da2cddda8d2244be17fe33fd3130af8c8041c8 (diff)
parentfce59e4038c02d88aca0ba6ef06db7ceb991d279 (diff)
downloademacs-68c015f511f43f6d24ac79ac78cd4a7b3cd5a89e.tar.gz
emacs-68c015f511f43f6d24ac79ac78cd4a7b3cd5a89e.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-66
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-642 Update from CVS
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 5e4d87595eb..0ab02941c9b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3307,7 +3307,7 @@ extern Lisp_Object Vdirectory_sep_char;
3307extern Lisp_Object safe_alloca_unwind (Lisp_Object); 3307extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3308 3308
3309#define USE_SAFE_ALLOCA \ 3309#define USE_SAFE_ALLOCA \
3310 int sa_count = SPECPDL_INDEX () 3310 int sa_count = SPECPDL_INDEX (), sa_must_free = 0
3311 3311
3312/* SAFE_ALLOCA allocates a simple buffer. */ 3312/* SAFE_ALLOCA allocates a simple buffer. */
3313 3313
@@ -3318,6 +3318,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3318 else \ 3318 else \
3319 { \ 3319 { \
3320 buf = (type) xmalloc (size); \ 3320 buf = (type) xmalloc (size); \
3321 sa_must_free++; \
3321 record_unwind_protect (safe_alloca_unwind, \ 3322 record_unwind_protect (safe_alloca_unwind, \
3322 make_save_value (buf, 0)); \ 3323 make_save_value (buf, 0)); \
3323 } \ 3324 } \
@@ -3325,10 +3326,12 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3325 3326
3326/* SAFE_FREE frees xmalloced memory and enables GC as needed. */ 3327/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
3327 3328
3328#define SAFE_FREE(size) \ 3329#define SAFE_FREE() \
3329 do { \ 3330 do { \
3330 if ((size) >= MAX_ALLOCA) \ 3331 if (sa_must_free) { \
3332 sa_must_free = 0; \
3331 unbind_to (sa_count, Qnil); \ 3333 unbind_to (sa_count, Qnil); \
3334 } \
3332 } while (0) 3335 } while (0)
3333 3336
3334 3337
@@ -3345,17 +3348,11 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3345 buf = (Lisp_Object *) xmalloc (size_); \ 3348 buf = (Lisp_Object *) xmalloc (size_); \
3346 arg_ = make_save_value (buf, nelt); \ 3349 arg_ = make_save_value (buf, nelt); \
3347 XSAVE_VALUE (arg_)->dogc = 1; \ 3350 XSAVE_VALUE (arg_)->dogc = 1; \
3351 sa_must_free++; \
3348 record_unwind_protect (safe_alloca_unwind, arg_); \ 3352 record_unwind_protect (safe_alloca_unwind, arg_); \
3349 } \ 3353 } \
3350 } while (0) 3354 } while (0)
3351 3355
3352#define SAFE_FREE_LISP(nelt) \
3353 do { \
3354 if (((nelt) * sizeof (Lisp_Object)) >= MAX_ALLOCA) \
3355 unbind_to (sa_count, Qnil); \
3356 } while (0)
3357
3358
3359 3356
3360#endif /* EMACS_LISP_H */ 3357#endif /* EMACS_LISP_H */
3361 3358