diff --git a/pkgs/racket-doc/scribblings/inside/embedding.scrbl b/pkgs/racket-doc/scribblings/inside/embedding.scrbl index 2064ca5831..96c0c58433 100644 --- a/pkgs/racket-doc/scribblings/inside/embedding.scrbl +++ b/pkgs/racket-doc/scribblings/inside/embedding.scrbl @@ -87,7 +87,7 @@ To embed Racket CGC in a program, follow these steps: @cpp{scheme_main_stack_setup} trampoline registers the C stack with the memory manager without creating a namespace.) - On 32-bit Windows, when support for parallelism is enabled in the Racket + On Windows, when support for parallelism is enabled in the Racket build (as is the default), then before calling @cpp{scheme_main_setup}, your embedding application must first call @cppi{scheme_register_tls_space}: @@ -101,7 +101,12 @@ To embed Racket CGC in a program, follow these steps: @verbatim[#:indent 2]{ static __declspec(thread) void *tls_space; - }} + } + + @history[#:changed "6.3" @elem{Calling @cpp{scheme_register_tls_space} is + required on all Windows variants, although the call + may be a no-op, depending on how Racket is + built.}]} @item{Configure the namespace by adding module declarations. The initial namespace contains declarations only for a few primitive diff --git a/pkgs/racket-doc/scribblings/inside/memory.scrbl b/pkgs/racket-doc/scribblings/inside/memory.scrbl index b010d2d1f8..eabedce650 100644 --- a/pkgs/racket-doc/scribblings/inside/memory.scrbl +++ b/pkgs/racket-doc/scribblings/inside/memory.scrbl @@ -899,7 +899,7 @@ overflow.} [void* ptr] [int tls_index])]{ -Only available on 32-bit Windows; registers @var{ptr} as the address of a +For Windows, registers @var{ptr} as the address of a thread-local pointer variable that is declared in the main executable. The variable's storage will be used to implement thread-local storage within the Racket run-time. See @@ -908,7 +908,10 @@ Only available on 32-bit Windows; registers @var{ptr} as the address of a The @var{tls_index} argument must be @cpp{0}. It is currently ignored, but a future version may use the argument to allow declaration of the thread-local variable in a dynamically linked - DLL.} + DLL. + +@history[#:changed "6.3" @elem{Changed from available only on 32-bit Windows + to available on all Windows variants.}]} @function[(void scheme_register_static [void* ptr] diff --git a/racket/src/racket/include/scheme.h b/racket/src/racket/include/scheme.h index 1563826591..1ede3d0c9b 100644 --- a/racket/src/racket/include/scheme.h +++ b/racket/src/racket/include/scheme.h @@ -1982,9 +1982,7 @@ MZ_EXTERN int scheme_main_stack_setup(int no_auto_statics, Scheme_Nested_Main _m typedef int (*Scheme_Env_Main)(Scheme_Env *env, int argc, char **argv); MZ_EXTERN int scheme_main_setup(int no_auto_statics, Scheme_Env_Main _main, int argc, char **argv); -#ifdef IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS MZ_EXTERN void scheme_register_tls_space(void *tls_space, int _tls_index); -#endif MZ_EXTERN void scheme_register_static(void *ptr, intptr_t size); #if defined(MUST_REGISTER_GLOBALS) || defined(GC_MIGHT_USE_REGISTERED_STATICS) diff --git a/racket/src/racket/src/salloc.c b/racket/src/racket/src/salloc.c index 5e4130fbf0..2c449cba8a 100644 --- a/racket/src/racket/src/salloc.c +++ b/racket/src/racket/src/salloc.c @@ -223,6 +223,11 @@ Thread_Local_Variables *scheme_external_get_thread_local_variables() XFORM_SKIP_ { return scheme_get_thread_local_variables(); } +#else +void scheme_register_tls_space(void *tls_space, int tls_index) XFORM_SKIP_PROC +{ + /* Nothing to do; provided for compatibility. */ +} #endif #ifdef IMPLEMENT_THREAD_LOCAL_EXTERNALLY_VIA_PROC