Re: What does -vtls compiler flag does and ...

2018-10-04 Thread Seb via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 20:58:01 UTC, Stanislav Blinov wrote: On Wednesday, 3 October 2018 at 20:41:15 UTC, welkam wrote: I was playing around with dmd`s make file trying to see if I can compile dmd with different compilers and different compilation flags. By playing around I found that

Re: What does -vtls compiler flag does and ...

2018-10-04 Thread bauss via Digitalmars-d-learn
On Thursday, 4 October 2018 at 13:48:24 UTC, welkam wrote: Oh so its like thread local globals sort of. My reasoning was that stack is a form of storage and is thread local so... Thread local storage IS "global" per thread though, instead of per process which "global" is in other languages.

Re: What does -vtls compiler flag does and ...

2018-10-04 Thread welkam via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 21:50:49 UTC, Stanislav Blinov wrote: Thread-local storage is memory allocated for each thread. Only static non-immutable variables go there. Regular variables on the stack aren't explicitly placed in any TLS, they're, well, on the stack as it is. Oh so its lik

Re: What does -vtls compiler flag does and ...

2018-10-03 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 20:41:15 UTC, welkam wrote: This flag blocks compilation and I want to just remove it but since I dont know what it is used for I hesitate. If my attempts were to be successful in compiling dmd with other compilers I would make pull request but now I have more q

Re: What does -vtls compiler flag does and ...

2018-10-03 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 21:39:12 UTC, welkam wrote: string a = "test"; is a variable that mutates so it should be thread local. Also ASM output shows that these variables are not optimized away so compiler should output something but it doesnt. Or I dont understand thread local storage

Re: What does -vtls compiler flag does and ...

2018-10-03 Thread welkam via Digitalmars-d-learn
string a = "test"; is a variable that mutates so it should be thread local. Also ASM output shows that these variables are not optimized away so compiler should output something but it doesnt. Or I dont understand thread local storage.

Re: What does -vtls compiler flag does and ...

2018-10-03 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 21:18:26 UTC, welkam wrote: On Wednesday, 3 October 2018 at 20:58:01 UTC, Stanislav Blinov wrote: No, all *static non-immutable* variables are thread-local by default, not just "all variables". I misspoke but this should write something https://run.dlang.io/is/3u

Re: What does -vtls compiler flag does and ...

2018-10-03 Thread welkam via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 20:58:01 UTC, Stanislav Blinov wrote: No, all *static non-immutable* variables are thread-local by default, not just "all variables". I misspoke but this should write something https://run.dlang.io/is/3u1wFp If you look at asm output there are "call _d_arraycatT@

Re: What does -vtls compiler flag does and ...

2018-10-03 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 3 October 2018 at 20:41:15 UTC, welkam wrote: I was playing around with dmd`s make file trying to see if I can compile dmd with different compilers and different compilation flags. By playing around I found that some dmd files are compiled with -vtls flag unconditionally and that

What does -vtls compiler flag does and ...

2018-10-03 Thread welkam via Digitalmars-d-learn
I was playing around with dmd`s make file trying to see if I can compile dmd with different compilers and different compilation flags. By playing around I found that some dmd files are compiled with -vtls flag unconditionally and that ldc do not support this flag. First I dont know what -vtls f