Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/rt/sections_elf_shared.d
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ else
void finiTLSRanges(Array!(void[])* rngs) nothrow @nogc
{
rngs.reset();
.free(rngs);
}

void scanTLSRanges(Array!(void[])* rngs, scope ScanDG dg) nothrow
Expand Down Expand Up @@ -369,7 +370,13 @@ else
* Thread local array that contains TLS memory ranges for each
* library initialized in this thread.
*/
@property ref Array!(void[]) _tlsRanges() @nogc nothrow { static Array!(void[]) x; return x; }
@property ref Array!(void[]) _tlsRanges() @nogc nothrow {
static Array!(void[])* x = null;
if (x is null)
x = cast(Array!(void[])*).calloc(1, Array!(void[]).sizeof);
safeAssert(x !is null, "Failed to allocate TLS ranges");
return *x;
}
//Array!(void[]) _tlsRanges;

enum _rtLoading = false;
Expand Down