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

Thomas Kuehne thomas-dloop at kuehne.cn
Sun Aug 20 13:40:51 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
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 
> (http://www.digitalmars.com/d/abi.html):
>
>      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?

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)

Thomas

-----BEGIN PGP SIGNATURE-----

iD8DBQFE6NYlLK5blCcjpWoRArjhAJ9EcyU1PZPbjLyIhdV8dwGMlC4uLgCghW82
6f8fgglEHaIwkLc9HBbGklk=
=5i4c
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-learn mailing list