> FWIW, pre X, MacOS used 'handles' extensively. We used to
> have fully floating objects, and we still had problems.
> Largely because most of the time you'd have to lock an
> objects handle when you called a member function, or passed
> off an internal reference (which we made a lot of effort to
> avoid), and the locks themselves became a nightmare to
> manage, causing the heap to lock up and fragment all over again.
This is how Win16 worked as well (mmm...LocalAlloc(), LocalFree()).
The problems you describe are basically going to exist anywhere you want
to be able to compact data behind the scenes while still allowing
pointers. I'm sure there are handle based memory managers that use
templates that allow for h->Lock()/h->Release() semantics as well, and
these would suffer from the same problem.
I have a suspicion that it's pretty much impossible to allow both direct
memory addressing AND compaction without incurring some gnarly headache
of convoluted manual lock/unlock behaviour.
-Hook
|