Hi Tony,
Just going to try to see how far this can be pushed. Disclaimer: my
knowledge of the black arts of memory management is limited...
Op 23-8-2012 3:54, Tony Rietwyk schreef:
Hi Jason,
If there are 5 public objects whose d-pointers reference the same
private object address, how are you going to update them when you
relocate the private object?
I don't think .Net stores addresses, just handles, so the relocate
only needs to update the handle info. That's why you have to go
through all of the marshalling crap when you do want to pass the
address somewhere!
Couldn't that be solved by making d-pointers not MyClassPrivate* but
MyClassPrivate**? Then, you'd only need to update one address...
I do think the idea is really crazy, but that does not mean that it
isn't interesting anyway. I guess you'd need your own allocator for the
objects as well. How else are you going to keep track of the actual
fragmentation? To complicate it even more: the program could even
'learn' between runs by keeping some stats between runs on memory usage,
to influence its own memory allocation strategies... And yes, I
understand that such things would be *very* complicated to do well, and
might not even work properly.
André
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest