Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Fix undefined order in module construction bug in rt.lifetime.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain Buclaw committed Sep 7, 2011
1 parent 21f0f02 commit 3e271ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/rt/dmain2.d
Expand Up @@ -70,6 +70,7 @@ extern (C) void _minit();
extern (C) void _moduleCtor();
extern (C) void _moduleDtor();
extern (C) void thread_joinAll();
extern (C) void rt_lifetimeInit();

version (OSX)
{
Expand Down Expand Up @@ -256,6 +257,7 @@ extern (C) bool rt_init(ExceptionHandler dg = null)
initStaticDataGC();
version (Windows)
_minit();
rt_lifetimeInit();
_moduleCtor();
_moduleTlsCtor();
runModuleUnitTests();
Expand Down Expand Up @@ -502,6 +504,7 @@ extern (C) int main(int argc, char** argv)
initStaticDataGC();
version (Windows)
_minit();
rt_lifetimeInit();
_moduleCtor();
_moduleTlsCtor();
if (runModuleUnitTests())
Expand Down
2 changes: 1 addition & 1 deletion src/rt/lifetime.d
Expand Up @@ -392,7 +392,7 @@ else
}

static __gshared size_t __blkcache_offset;
shared static this()
extern(C) void rt_lifetimeInit()
{
void[] tls = thread_getTLSBlock();
__blkcache_offset = (cast(void *)&__blkcache_storage) - tls.ptr;
Expand Down

0 comments on commit 3e271ee

Please sign in to comment.