Commits

Iain Buclaw  committed 41218d9

Issue #214 - Segfault Allocating from Shared Static C'tor

  • Participants
  • Parent commits 0ada920

Comments (0)

Files changed (2)

File d/druntime/rt/dmain2.d

 extern (C) void _moduleCtor();
 extern (C) void _moduleDtor();
 extern (C) void thread_joinAll();
+extern (C) void rt_lifetimeInit();
 
 version (OSX)
 {
             version (MinGW) {} else
             _minit();
         }
+        rt_lifetimeInit();
         _moduleCtor();
         _moduleTlsCtor();
         runModuleUnitTests();
             version (MinGW) {} else
             _minit();
         }
+        rt_lifetimeInit();
         _moduleCtor();
         _moduleTlsCtor();
         if (runModuleUnitTests())

File d/druntime/rt/lifetime.d

 }
 
 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;