On 6/14/2016 3:38 PM, Guillaume Boucher wrote:
Isn't it guaranteed that x.sizeof >= x.alignof? (At least it is in C and C++.) So the alignment should be of type size_t and not of type uintptr_t.Also in general cast(uint)ptr%alignment is wrong since alignment does not need to be 32 bit. However, cast(size_t)ptr%alignment is be correct in any case.
There is no conceivable case where alignment will be > 32 bits, nor not being a power of 2.