[Aldor-l] alignof

Stephen Watt watt at scl.csd.uwo.ca
Fri Mar 21 20:15:32 EDT 2008


Yes, we use alignof only for some low level things.  I don't recall off hand
which ones survive to this day, but they have included understanding pointer alingment
to determine how many passes to make on the stack for GC  and  some structure packing.

-- Stephen


On Fri, Mar 21, 2008 at 06:58:05PM -0500, Gabriel Dos Reis wrote:
> Stephen Watt <watt at scl.csd.uwo.ca> writes:
> 
> | Pippijn,
> | 
> | Can you give an example of a compiler and input for which the macro is incorrect ?
> 
> GCC, on x86.  Take T=double.  On my machine (x86), I get 8 with the macro.
> 
> The snag is that the alignment of double is not the same when it is a
> member of a struct (alignment 4), or when it is the type of a
> standalone datum (8).   So, whether you get the right answer depends
> on the context of use. 
> 
> I knew this thread was ringing a bell to me. 
> 
>   http://gcc.gnu.org/ml/gcc/2003-04/msg01178.html
> 
> 
> So, the exact value matters only if you're doing something very low-level
> that it does matter whether the double is a member of a struct or not.
> I do not know the details of Aldor source code, so only you and
> Pippijn can conclude :-)
> 
> -- Gaby



More information about the Aldor-l mailing list