consing_until_gc to speed up maybe_gc when GC is inhibited. */
static void
-allow_garbage_collection (void *ptr)
+allow_garbage_collection (intmax_t consing)
{
- object_ct *p = ptr;
- consing_until_gc = *p;
+ consing_until_gc = consing;
garbage_collection_inhibited--;
}
inhibit_garbage_collection (void)
{
ptrdiff_t count = SPECPDL_INDEX ();
- object_ct consing = consing_until_gc;
- record_unwind_protect_ptr (allow_garbage_collection, &consing);
+ record_unwind_protect_intmax (allow_garbage_collection, consing_until_gc);
garbage_collection_inhibited++;
consing_until_gc = OBJECT_CT_MAX;
return count;
case SPECPDL_UNWIND_ARRAY:
case SPECPDL_UNWIND_PTR:
case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_INTMAX:
case SPECPDL_UNWIND_EXCURSION:
case SPECPDL_UNWIND_VOID:
case SPECPDL_BACKTRACE:
grow_specpdl ();
}
+void
+record_unwind_protect_intmax (void (*function) (intmax_t), intmax_t arg)
+{
+ specpdl_ptr->unwind_intmax.kind = SPECPDL_UNWIND_INTMAX;
+ specpdl_ptr->unwind_intmax.func = function;
+ specpdl_ptr->unwind_intmax.arg = arg;
+ grow_specpdl ();
+}
+
void
record_unwind_protect_excursion (void)
{
case SPECPDL_UNWIND_INT:
this_binding->unwind_int.func (this_binding->unwind_int.arg);
break;
+ case SPECPDL_UNWIND_INTMAX:
+ this_binding->unwind_intmax.func (this_binding->unwind_intmax.arg);
+ break;
case SPECPDL_UNWIND_VOID:
this_binding->unwind_void.func ();
break;
case SPECPDL_UNWIND_ARRAY:
case SPECPDL_UNWIND_PTR:
case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_INTMAX:
case SPECPDL_UNWIND_VOID:
case SPECPDL_BACKTRACE:
break;
case SPECPDL_UNWIND_ARRAY:
case SPECPDL_UNWIND_PTR:
case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_INTMAX:
case SPECPDL_UNWIND_EXCURSION:
case SPECPDL_UNWIND_VOID:
case SPECPDL_BACKTRACE:
case SPECPDL_UNWIND_PTR:
case SPECPDL_UNWIND_INT:
+ case SPECPDL_UNWIND_INTMAX:
case SPECPDL_UNWIND_VOID:
break;
Its elements are potential Lisp_Objects. */
SPECPDL_UNWIND_PTR, /* Likewise, on void *. */
SPECPDL_UNWIND_INT, /* Likewise, on int. */
+ SPECPDL_UNWIND_INTMAX, /* Likewise, on intmax_t. */
SPECPDL_UNWIND_EXCURSION, /* Likewise, on an execursion. */
SPECPDL_UNWIND_VOID, /* Likewise, with no arg. */
SPECPDL_BACKTRACE, /* An element of the backtrace. */
void (*func) (int);
int arg;
} unwind_int;
+ struct {
+ ENUM_BF (specbind_tag) kind : CHAR_BIT;
+ void (*func) (intmax_t);
+ intmax_t arg;
+ } unwind_intmax;
struct {
ENUM_BF (specbind_tag) kind : CHAR_BIT;
Lisp_Object marker, window;
extern void record_unwind_protect_array (Lisp_Object *, ptrdiff_t);
extern void record_unwind_protect_ptr (void (*) (void *), void *);
extern void record_unwind_protect_int (void (*) (int), int);
+extern void record_unwind_protect_intmax (void (*) (intmax_t), intmax_t);
extern void record_unwind_protect_void (void (*) (void));
extern void record_unwind_protect_excursion (void);
extern void record_unwind_protect_nothing (void);