[Interest] memory fragmentation?

Konstantin Tokarev annulen at yandex.ru
Thu Aug 23 11:10:27 CEST 2012


22.08.2012, 21:27, "Jason H" <scorp1us at yahoo.com>:
> Now, here's my crazy idea. If we have small objects - say Qt's interface classes, and large objects, say Qt's private classes, then could we do some d-ptr trickery where Qt can reallocate and copy/move the memory around and reassign a d-ptr? We can't get all the coolness of .NET's GC, but we can come close, at least for "large" objects (objects using d-ptrs). We've already talked about the GUI, but what is more interesting to me is a QObject hierarchy (not necessarily QWidgets) in that you could say for this large, old tree of objects, do something that would result in "better" (more contiguous) memory allocations.

I think this idea is more applicable to smart pointers (like QSharedPointer and QSharedDataPointer). GC would be able to move their data without breaking user code (unless somebody stores value of raw pointer somewhere which already may be considered bad practice).

It would also be possible to convert some d-ptrs to such smart pointers if there is any gain.

-- 
Regards,
Konstantin



More information about the Interest mailing list