What would be the consequence of implementing interfaces as fat pointers ?

Manu turkeyman at gmail.com
Mon Mar 31 02:32:06 PDT 2014


On 31 March 2014 18:18, Walter Bright <newshound2 at digitalmars.com> wrote:

> On 3/30/2014 7:10 PM, Manu wrote:
>
>> On 31 March 2014 11:39, bearophile <bearophileHUGS at lycos.com
>> <mailto:bearophileHUGS at lycos.com>> wrote:
>>
>>     Manu:
>>
>>
>>         The most annoying thing about a hidden vtable pointer is it breaks
>>         alignment.
>>
>>
>>     D class instances have two hidden fields.
>>
>>
>> Oh yeah... well that loses a lot of appeal from me in that case ;)
>>
>
> On 64 bits, the two fields means the rest starts at 16 byte alignment -
> ideal for SIMD!
>

Most computers aren't 64bit though. The fact that the pointers change in
size between platforms is a huge nuisance. I often find I end up with some
very annoying #ifdef's at the start of tightly packed classes to deal with
this issue in C++.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140331/a7099015/attachment.html>


More information about the Digitalmars-d mailing list