Hello Charles
in the link at O2 forum
https://www.oxygenbasic.org/forum/index.php?topic=1858.msg20109;topicseen#msg20109 (https://www.oxygenbasic.org/forum/index.php?topic=1858.msg20109;topicseen#msg20109)
you mentioned that in 64bits
QuoteUDTs are padded out to the size of their largest primitive member
does this means that the padding is automatically done by the O2 compiler?
and there is no need for us to add in the padding manually? for instance
typedef struct tagNMHDR {
HWND hwndFrom; '8
UINT_PTR idFrom; '8
UINT code; '4
'4 bytes padding
} NMHDR;
the last 4 bytes padding is automatically added in if we compile to 64bits?
Hello Charles
For example in the below UDT, the total size = 8 + 4 + 4 = 16
then would O2 compiler pad in another 8 bytes automatically when we compile to 64bits ?
uses Rtl64
typedef struct myUDT {
HWND hwndM; '8
DWORD myVar1; '4
DWORD myVar2; '4
} myDat;
Hi Chris,
The padding is automatic, and is there to ensure optimal memory alignment of each primitive member.
So an 8+4+4 does not require padding.
You can check the overall size of a UDT with SIZEOF.
Thanxx a lot Charles
O2 is very flexible :)