Windows: make scheme_register_tls_space() always available
To make the API consistent for MSVC versus MinGW builds, make a functional formerly required for embedding on 32-bit Windows always available and required for all Windows variants.
This commit is contained in:
parent
8620f95763
commit
ea6cef5246
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user