Some GC and emulated TLS questions (GDC related)

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 16 05:28:53 PDT 2017


Am Fri, 14 Jul 2017 12:47:55 +0000
schrieb Kagamin <spam at here.lot>:

> Just allocate emutls array in managed heap and pin it somewhere, 
> then everything referenced by it will be preserved.

This is basically the option of replicating GCC-style emutls in
druntime. This is quite simple to implement and you don't even need
special pinning, as the Thread instance object in core.thread can refer
to the TLS array.

This solution can't be implemented in libgcc though, as obviously the
GC is not always available to allocate the arrays in pure C programs ;-)


-- Johannes



More information about the Digitalmars-d mailing list