#endif
#endif
+size_t dynamic_space_size = DEFAULT_DYNAMIC_SPACE_SIZE;
+
inline static boolean
forwarding_pointer_p(lispobj *pointer) {
lispobj first_word=*pointer;
scavenge(&function_ptr->name, 1);
scavenge(&function_ptr->arglist, 1);
scavenge(&function_ptr->type, 1);
+ scavenge(&function_ptr->xrefs, 1);
}
return n_words;
}
return (NULL);
}
+
+boolean
+maybe_gc(os_context_t *context)
+{
+#ifndef LISP_FEATURE_WIN32
+ struct thread *thread = arch_os_get_current_thread();
+#endif
+
+ fake_foreign_function_call(context);
+ /* SUB-GC may return without GCing if *GC-INHIBIT* is set, in
+ * which case we will be running with no gc trigger barrier
+ * thing for a while. But it shouldn't be long until the end
+ * of WITHOUT-GCING.
+ *
+ * FIXME: It would be good to protect the end of dynamic space for
+ * CheneyGC and signal a storage condition from there.
+ */
+
+ /* Restore the signal mask from the interrupted context before
+ * calling into Lisp if interrupts are enabled. Why not always?
+ *
+ * Suppose there is a WITHOUT-INTERRUPTS block far, far out. If an
+ * interrupt hits while in SUB-GC, it is deferred and the
+ * os_context_sigmask of that interrupt is set to block further
+ * deferrable interrupts (until the first one is
+ * handled). Unfortunately, that context refers to this place and
+ * when we return from here the signals will not be blocked.
+ *
+ * A kludgy alternative is to propagate the sigmask change to the
+ * outer context.
+ */
+#ifndef LISP_FEATURE_WIN32
+ if(SymbolValue(INTERRUPTS_ENABLED,thread)!=NIL) {
+ sigset_t *context_sigmask = os_context_sigmask_addr(context);
+ /* What if the context we'd like to restore has GC signals
+ * blocked? Just skip the GC: we can't set GC_PENDING, because
+ * that would block the next attempt, and we don't know when
+ * we'd next check for it -- and it's hard to be sure that
+ * unblocking would be safe. */
+ if (sigismember(context_sigmask,SIG_STOP_FOR_GC)) {
+ undo_fake_foreign_function_call(context);
+ return 1;
+ }
+ thread_sigmask(SIG_SETMASK, context_sigmask, 0);
+ }
+ else
+ unblock_gc_signals();
+#endif
+ funcall0(SymbolFunction(SUB_GC));
+ undo_fake_foreign_function_call(context);
+ return 1;
+}