From a4964044111a461ac1f7eff1fee58ee308334bfc Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 5 Jan 2013 07:31:38 -0700 Subject: [PATCH] setup/configtab: prevent cross-module inlining of configuration The intent is that the configuration module can be rewritten without recompiling code that uses it, so don't let the compiler inline configuration values. --- collects/setup/configtab.rkt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/collects/setup/configtab.rkt b/collects/setup/configtab.rkt index 364b095534..02854c296c 100644 --- a/collects/setup/configtab.rkt +++ b/collects/setup/configtab.rkt @@ -89,7 +89,7 @@ (define ((mkdef v) id) (if (memq id syms) '() - (list #`(define #,(datum->syntax stx id stx) #,v)))) + (list #`(define #,(datum->syntax stx id stx) (thwart-inline #,v))))) (syntax-property #`(#%plain-module-begin (provide #,@path-exports #,@string-exports #,@flag-exports) @@ -98,3 +98,10 @@ #,@(apply append (map (mkdef #'use-default) string-exports)) #,@(apply append (map (mkdef #'#f) flag-exports))) 'certify-mode 'transparent))))]))) + +;; Hack: we want to be able to replace "config.rkt" and recompile it +;; in-place, without recompiling bytecode that may depend on it. +;; To enable that, ensure that the exports of a configuration are +;; not inlined. +(define thwart-inline #f) +(set! thwart-inline (lambda (v) v))