From: Matt Birkholz Date: Sat, 16 Sep 2017 21:38:27 +0000 (-0700) Subject: microcode: Do not save history_register locally. X-Git-Tag: mit-scheme-pucked-9.2.12~14^2~27 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=0093a03574bbba793d955f988790511cd83690af;p=mit-scheme.git microcode: Do not save history_register locally. The required change to C_call_scheme is described but not implemented. C_call_scheme has other problems(?). Preferring a rotated history to a broken history (broken by a GC during a callback) for now. --- diff --git a/src/microcode/interp.h b/src/microcode/interp.h index 2253554f1..163a4ec49 100644 --- a/src/microcode/interp.h +++ b/src/microcode/interp.h @@ -63,6 +63,7 @@ USA. #define CHECK_RETURN_CODE(code, offset) \ ((CONT_RET (offset)) == (MAKE_RETURN_CODE (code))) +#if 0 /* Saving history is required for C_call_scheme to work correctly because the recursive call to Interpret() can rotate the history. */ @@ -72,6 +73,15 @@ USA. PRIMITIVE_APPLY (primitive); \ history_register = APFI_saved_history; \ } while (0) + +#else +/* C_call_scheme must save/restore history_register on/from the stack + so that it will be relocated if the call to Interpret() causes a + garbage collection. */ + +#define APPLY_PRIMITIVE_FROM_INTERPRETER PRIMITIVE_APPLY + +#endif /* Stack manipulation */