Well it's not really layout, because alignment is handled by pack option. It is how the field gets allocated. At this point I believe it will be more complex to come up with custom allocation option, precisely because it's up to each compiler to allocate the structure. Such flexibility will add a lot of complexity and it might not payoff. This is debatable, but I would go with a 3 option strategy at this point - native, GCC, MSVC and if we actually find interop issues with other compilers we can look into custom allocation.

I will try to refactor the C code to more easily accommodate a mode option (while leaving behavior the same for now), then we can decide how the library interface should look like.

Thank you,

On Sat, Jun 25, 2011 at 4:37 PM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Vlad Riscutia wrote:
Longer term though, I think it would be better to add a property on the Structure class for configurable allocation strategy, for example Native (default), GCC, MSVC

It could also be good to have a mode which lets you specify
*exactly* how the bits are laid out, independent of any
particular compiler.