Tail pad optimization, cache friendlyness and C++ interrop

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 10 12:20:23 PDT 2014


10-Jun-2014 11:30, deadalnix пишет:
[snip]
> extern(D) do tail pad optimize.
> extern(C) struct do not tail pad optimize.
> extern(C++) do tail pad with C++ rules:
> do not tail pad if (otherwise tail pad):
> 1. has no non-static data members that aren't standard-layout
> 2. has no virtual functions and no virtual base classes
> 3. has the same access control for all non-static data members
> 4. has no base classes that aren't standard-layout
> 5. either has no base class with non-static data members or has no
> non-static data members in the most derived class and only one base with
> them
> 6. has no base classes of the same type as the first non-static data member
>
> thought ?

Would be useful, but as proposed it might break some of current C 
bindings silently (unless it's extern(C): at the top of file).


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list