August 20, 2006 Re: Several questions (about inline assembly, ddoc for templates, and foreach) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | Thomas Kuehne wrote: > -----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? The whole ABI needs a rewrite in terms of pointer size rather than fixed offset. > 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. Sean |
Copyright © 1999-2021 by the D Language Foundation