I am on 64-bit Linux.
I defined a struct that it 8 bytes in total.
align(1) struct MessageBase{
align(1):
ushort qc;
ushort wc;
ushort id;
ushort contentLength;
void[0] content;
}
I defined a function in this struct that tries to set a pointer
to "conte
On Friday, 6 February 2015 at 03:59:51 UTC, tcak wrote:
I am on 64-bit Linux.
I defined a struct that it 8 bytes in total.
align(1) struct MessageBase{
align(1):
ushort qc;
ushort wc;
ushort id;
ushort contentLength;
void[0] content;
}
I defined a funct
On Friday, 6 February 2015 at 04:10:08 UTC, tcak wrote:
On Friday, 6 February 2015 at 03:59:51 UTC, tcak wrote:
I am on 64-bit Linux.
I defined a struct that it 8 bytes in total.
align(1) struct MessageBase{
align(1):
ushort qc;
ushort wc;
ushort id;
ushort cont
On 02/05/2015 07:59 PM, tcak wrote:
> writeln( "Without: ", (&this + id.offsetof) );
In pointer arithmetic, the increment value means "that many *objects*
away", not "than many bytes away".
Since id.offsetof is 4, you are calculating 4 MessageBase objects away
(4*8==32 bytes away).
> write