At 1:48 PM -0800 4/7/99, Dan Hewins wrote:
>This leads to another question: why can't the handle be recovered properly?
>Is there something about handles, locked handles, and recovering handles
>that I don't know and should know.
There aren't actually 'real' handles for chunks in a ROM heap. There would
be no point -- the chunks can't be moved or resized, so having master
pointers for them is just a waste of space, and space is precious. (even
ROM space)
To make the APIs work, whenever you get a handle to a ROM-based resource a
'fake' handle is allocated from a small pool of master pointers in the
dynamic heap. However, because you can't modify ROM chunks, there's no way
for the ROM chunk to point back to the fake master pointer. ...so
MemPtrRecoverHandle can't work the same way it does for RAM-based handles.
We could probably make MemPtrRecoverHandle work by noticing that it's a ROM
chunk and looping through all the fake master pointers to find the right
one. ...it'll be slow, but at least it won't crash. I'll add that to our
bug list.
Insert the appropriate disclaimers about this info being relevant only to
current releases, subject to change in the future, etc.
--Bob