[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: |
Tue, 26 Oct 2004 18:47:34 -0400 |
Index: emacs/src/lisp.h
diff -c emacs/src/lisp.h:1.504 emacs/src/lisp.h:1.505
*** emacs/src/lisp.h:1.504 Mon Oct 18 12:26:02 2004
--- emacs/src/lisp.h Tue Oct 26 22:37:02 2004
***************
*** 3263,3269 ****
extern Lisp_Object safe_alloca_unwind (Lisp_Object);
#define USE_SAFE_ALLOCA \
! int sa_count = SPECPDL_INDEX ()
/* SAFE_ALLOCA allocates a simple buffer. */
--- 3263,3269 ----
extern Lisp_Object safe_alloca_unwind (Lisp_Object);
#define USE_SAFE_ALLOCA \
! int sa_count = SPECPDL_INDEX (), sa_must_free = 0
/* SAFE_ALLOCA allocates a simple buffer. */
***************
*** 3274,3279 ****
--- 3274,3280 ----
else \
{ \
buf = (type) xmalloc (size); \
+ sa_must_free++; \
record_unwind_protect (safe_alloca_unwind, \
make_save_value (buf, 0)); \
} \
***************
*** 3281,3290 ****
/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
! #define SAFE_FREE(size) \
do { \
! if ((size) >= MAX_ALLOCA) \
unbind_to (sa_count, Qnil); \
} while (0)
--- 3282,3293 ----
/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
! #define SAFE_FREE() \
do { \
! if (sa_must_free) { \
! sa_must_free = 0; \
unbind_to (sa_count, Qnil); \
+ } \
} while (0)
***************
*** 3301,3317 ****
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 */
--- 3304,3314 ----
buf = (Lisp_Object *) xmalloc (size_); \
arg_ = make_save_value (buf, nelt); \
XSAVE_VALUE (arg_)->dogc = 1; \
+ sa_must_free++; \
record_unwind_protect (safe_alloca_unwind, arg_); \
} \
} while (0)
#endif /* EMACS_LISP_H */