+#ifdef LISP_FEATURE_GENCGC
+ struct thread *th = arch_os_get_current_thread();
+
+ /* FIXME: OOAO violation: see arch_pseudo_* */
+ SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(0),th);
+ SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(1),th);
+ result = alloc(bytes);
+ SetSymbolValue(PSEUDO_ATOMIC_ATOMIC, make_fixnum(0),th);
+ if (fixnum_value(SymbolValue(PSEUDO_ATOMIC_INTERRUPTED,th)))
+ /* Even if we gc at this point, the new allocation will be
+ * protected from being moved, because result is on the c stack
+ * and points to it. */
+ do_pending_interrupt();
+#else
+ /* FIXME: this is not pseudo atomic at all, but is called only from
+ * interrupt safe places like interrupt handlers. MG - 2005-08-09 */
+ result = dynamic_space_free_pointer;