AccessUnalignedMemory version

Guillaume Chatelet via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 16 04:38:06 PST 2016


It came up on this thread a few days ago
https://github.com/D-Programming-Language/phobos/pull/3916#issuecomment-171373707

Some architectures do not allow unaligned loads/writes.
It would be nice to have a Version for this:

version (AccessUnalignedMemory)
{
   foo(cast(ulong[])(ubyte)buffer));
}
else
{
   // copy in an aligned buffer and then call foo
}

Questions:
- Is it worth the addition ?
- Does anyone has a better naming suggestion ?
- Where should we put such a definition ?


More information about the Digitalmars-d mailing list