How do I make LDC use the stack only?

max haughton maxhaton at gmail.com
Thu Nov 11 05:34:44 UTC 2021


On Thursday, 11 November 2021 at 03:10:48 UTC, Mateus wrote:
> I'm creating a [D operating system 
> kernel](https://github.com/m4t3uz/leaf-d). Thread local storage 
> (TLS) is not available so it cannot be used. My D kernel 
> compiles correctly with DMD but it fails with runtime errors on 
> LDC. I guess LDC promotes some stack variables to TLS for 
> example:
>
> ```d
> void f() {
>     ubyte[15] a; // works
>     ubyte[16] b; // does not work
>     __gshared ubyte[16] c; // works
>     MyStruct d; // does not work
> }
> ```
>
> How do I make LDC use the stack only? Should I file a bug 
> report?

I Need a definition of what "does not work" means i.e. with 
output of the error.


More information about the digitalmars-d-ldc mailing list