API problems (Was: future versions)
Marc Mutz
Marc.Mutz at uni-bielefeld.de
Sun Feb 8 10:25:09 GMT 2004
On Saturday 07 February 2004 12:18, Friedrich W. H. Kossebau wrote:
<snip>
> But is this really memory intensive? Please, can you correct me or
> give some numbers?
<snip>
Run attached program, which is slightly adapted (and fixed) from Volume
2 of Thinking in C++.
No, it's not eating megabytes of memory. But it's still more then you'd
expect if you didn't think it through. After all, all the classes there
have the same payload of a single int (4 bytes here), and the virtual
inheritance makes sure that there's only _one_ MBase object even in MI.
Now, of course OQbject is ~40 bytes and so the 40 bytes from ten
implemented interfaces is not nearly that dramatic as in the simple
example, but I'd still consider this surprisingly memory intensive.
_I_ was surprised, at least.
Marc
--
If free-software authors lose the right to disclaim all warranties and
find themselves getting sued over the performance of the programs
they've written, they'll stop contributing free software to the world.
-- Bruce Perens: Open Sources: Voices from the Open Source Revolution
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virtual-inheritance.cpp
Type: text/x-c++src
Size: 886 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040208/70c7abd4/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040208/70c7abd4/attachment.sig>
More information about the kde-core-devel
mailing list