std.typecons scoped question

monarch_dodra monarchdodra at gmail.com
Sat Sep 7 11:40:52 PDT 2013


On Saturday, 7 September 2013 at 09:24:29 UTC, Martin wrote:
> Sorry, what I meant was:
> An extra 8 bytes for alignment

AFAIK, the problem is note one of packing, but of aligning the 
"Payload" regardless of the where the "ScopedResult" itself is 
located on the stack.

If "A" needs to be 16 aligned, but B is in a position of "4 + 
16*N", then the payload will need to shift A an extra 12 bytes.

And I don't think there's any way around this.

THAT SAID, I *think* the current implementation is very 
conservative. On my machine, B's size is 48 (!).

We could definitely reduce the extra padding.

You should file this as a bug.


More information about the Digitalmars-d mailing list