Re: Variables & kind of memory

2022-04-23 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 23 April 2022 at 17:14:22 UTC, Alain De Vos wrote: Maybe i can use gdb to see more info. This is not a gdb forum but if someone knows the commands to verify the segments/heap/stack ? Maybe it'll be helpful. The following output is from another compiler: ``` GLV:address :14eb4

Re: Variables & kind of memory

2022-04-23 Thread Alain De Vos via Digitalmars-d-learn
On Saturday, 23 April 2022 at 10:46:42 UTC, Stanislav Blinov wrote: On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: Feel free to elaborate. Variables declared at module scope, and static variables in function/aggregate scopes, unless also annotated as `shared` or `__gshared`

Re: Variables & kind of memory

2022-04-23 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: Feel free to elaborate. Variables declared at module scope, and static variables in function/aggregate scopes, unless also annotated as `shared` or `__gshared`, are thread-local, therefore are placed in thread-local storage. Th

Re: Variables & kind of memory

2022-04-22 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 23 April 2022 at 05:01:51 UTC, Alain De Vos wrote: On Saturday, 23 April 2022 at 04:52:39 UTC, Alain De Vos wrote: On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: I wrote a simple test program: ``` import std.stdio:writefln; [...] BBB: is probably the data-segmen

Re: Variables & kind of memory

2022-04-22 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: int [] GLV=[1,2]; int [2] GLF=[1,2]; static int [] GSLV=[1,2]; static int [2] GSLF=[1,2]; FYI, `static` has no effect at module scope.

Re: Variables & kind of memory

2022-04-22 Thread Alain De Vos via Digitalmars-d-learn
On Saturday, 23 April 2022 at 04:52:39 UTC, Alain De Vos wrote: On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: I wrote a simple test program: ``` import std.stdio:writefln; [...] BBB: is probably the data-segment. Remains AAA ? Could AAA be the bss-segment ?

Re: Variables & kind of memory

2022-04-22 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: I wrote a simple test program: ```d import std.stdio:writefln; int [] GLV=[1,2]; int [2] GLF=[1,2]; // paste it ->> static int [] GSLV=[1,2]; static int [2] GSLF=[1,2]; void main() { } ``` First of all, there is no such thing

Re: Variables & kind of memory

2022-04-22 Thread Alain De Vos via Digitalmars-d-learn
On Saturday, 23 April 2022 at 03:41:17 UTC, Alain De Vos wrote: I wrote a simple test program: ``` import std.stdio:writefln; [...] BBB: is probably the data-segment. Remains AAA ?

Variables & kind of memory

2022-04-22 Thread Alain De Vos via Digitalmars-d-learn
I wrote a simple test program: ``` import std.stdio:writefln; int [] GLV=[1,2]; int [2] GLF=[1,2]; static int [] GSLV=[1,2]; static int [2] GSLF=[1,2]; void main(){ writefln("-"); writefln("GLV:address :%12x:AAA",&GLV); writefln("GLF:address :%12x:AAA",&GLF); writefln("GSLV:address: