On Friday, 8 August 2014 at 18:20:41 UTC, ketmar wrote:
yeah, chars (and bytes, and so on) are not aligned. i.e.
align(1) struct B {
int qtim;
int bid;
int ofr;
int bidsiz;
int ofrsiz;
short mode;
char ex;
byte mmid;
char z;
}
has sizeof == 25. not sure if specs mentions
p.s. seems that aligning works only on ints. i.e. on types which
has sizeof = default platform align.
yeah, chars (and bytes, and so on) are not aligned. i.e.
align(1) struct B {
int qtim;
int bid;
int ofr;
int bidsiz;
int ofrsiz;
short mode;
char ex;
byte mmid;
char z;
}
has sizeof == 25. not sure if specs mentions this, but they
should.
(Original discussion:
http://forum.dlang.org/thread/fckwpddiwxonabqaf...@forum.dlang.org#post-pskjgieddhpntzaokohj:40forum.dlang.org)
align(1) struct A
{
align(1):
int qtim;
int bid;
int ofr;
int bidsiz;
int ofrsiz;
short mode;
On Thursday, 7 August 2014 at 17:22:15 UTC, Marc Schütz wrote:
(Original discussion:
http://forum.dlang.org/thread/fckwpddiwxonabqaf...@forum.dlang.org#post-pskjgieddhpntzaokohj:40forum.dlang.org)
I would expect `B` to have a gap between `ex` and `mmid`. AFAIK
the outer `align(1)` only
Still watching this, but the Dconf 2014 bare metal presentation
gets into it a bit...
http://youtu.be/qErXPomAWYI?t=37m20s