Any chance to avoid monitor field in my class?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 8 07:57:37 PDT 2014


On Wed, 07 May 2014 10:44:55 -0400, Yuriy <yuriy.glukhov at gmail.com> wrote:

> Hello, is there a way of reducing size of an empty class to just vtbl? I  
> tried to declare it as extern(C++) which works, but has a nasty side  
> effect of limited mangling.

The de-facto minimum size of a class is 16 bytes, due to the minimum block  
size of the heap.

8 bytes vtbl pointer on 64-bit systems would still allocate into 16-byte  
blocks.

-Steve


More information about the Digitalmars-d-learn mailing list