Several questions (about inline assembly, ddoc for templates, and foreach)

Sean Kelly sean at
Sun Aug 20 15:49:48 PDT 2006

Thomas Kuehne wrote:
> Hash: SHA1
> Sean Kelly schrieb am 2006-08-20:
>> Thomas Kuehne wrote:
>>> It's implementation dependent. Phobos, GPhobos and Ares currently use
>>> # struct Array{
>>> #    size_t len;
>>> #    void* ptr;
>>> # }
>> I think this is actually required.  According to the ABI 
>> (
>>      Arrays
>>      A dynamic array consists of:
>>      offset   contents
>>      0        array dimension
>>      4        pointer to array data
> Thus on a 64bit system, an array may only contain (2^32 - 1) elements
> and every access suffers from a bad alignment of the data pointer?

The whole ABI needs a rewrite in terms of pointer size rather than fixed 

> Walter's ABI and Phobos are going to require quite a bit of a makeover
> if they are ported to a non-32bit system. A sample:
> Phobos: dmd/src/phobos/internal/aaA.d:454
> long _aaValues(AA aa, size_t keysize, size_t valuesize)
> GPhobos(from gdc): d/phobos/internal/aaA.d:456
> Array _aaValues(AA aa, size_t keysize, size_t valuesize)

Yup.  Fortunately, most of the pointer size-related diffs between Phobos 
and GPhobos are in this file, so the changes shouldn't be too onerous. 
Particularly since they can all be revealed by a diff between the two.


More information about the Digitalmars-d-learn mailing list