Same code different behaviour in debug & release mode?

Robert M. Münch robert.muench at saphirion.com
Sun May 19 16:11:19 UTC 2019


I have the following code I compile in release mode but with 
"debugInfo" bulildOptions in my dub.json:

gob root = win.layout_root = new gob();

After executing this code line I see this in the debugger:


Name
Wert
Typ
◢
root
0x000000f17deff760 {node=0x00007ff629fb0000 {__guard_fids_table} {}, 
container=false, level=0, ax0=-2.7520788e+14, ...}
gui.gob

▶ __vfptr
0x0000000000000000
void*[36]*

node
0x00007ff629fb0000 {__guard_fids_table} {}
yoga.yoga.YGNode*

container
false
bool

level
0
int

ax0
-2.7520788e+14
float

ay0
7.4268819e-43
float

fill
true
bool

▶ id
""...
string
◢
win.layout_root
0x00000212d90481c0 {node=0x00000212d995eb90 {}, container=false, 
level=0, ax0=0, ay0=0, fill=false, id=""}
gui.gob

▶ __vfptr
0x00007ff62a4bd410 {_D3gui3gob6__vtblZ} {[0x00007ff62a4bd350 
{_D3gui3gob7__ClassZ}, 0x00007ff62a12c6c6 
{_D6object6Object8toStringMFZAya}, ...]}
void*[36]*

node
0x00000212d995eb90 {}
yoga.yoga.YGNode*

container
false
bool

level
0
int

ax0
0
float

ay0
0
float

fill
false
bool

id
""
string

I'm wondering why the root and win.layout_root values are not the same? 
What's happening here? I thought that root is a class reference which 
uses the same data as win.layout_root.

When I compile in debug mode and run the same code, the values are the same.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20190519/38f1af1d/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list