[phobos] byte alignment for arrays

Sean Kelly sean at invisibleduck.org
Tue Jun 29 09:48:39 PDT 2010


I think it should be enough just to make it a documented requirement for allocators.  It's not like it will ever change, right?

On Jun 28, 2010, at 2:07 PM, Steve Schveighoffer wrote:

> All,
> 
> Should there be something in the runtime that defines the minimum align size for things like memory blocks?  That might make this easier to deal with from a design perspective...
> 
> ----- Original Message ----
>> From: Jason Spencer <spencer8 at sbcglobal.net>
>> 
>> Hmmm.  The natural thing would be to have some type to describe these 
>> 128-bit values (akin to __m128 in gcc, Intel and MS compilers) and use sizeof on 
>> that.  I don't see that D has any MMX/SSE intrinsics, so I don't know if 
>> there is a standard type.  If you don't have such a thing defined by the 
>> compiler, I'd be tempted to define it, based on which version of the compiler 
>> will compile this code (i.e. 32- or 64-bit dmd).  Then you can use that in 
>> your sizeof.  Maybe you'll get lucky, and that will become standard 
>> :)
> 
> 
> 
> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos



More information about the phobos mailing list