>Thanks for the response, but if the handle is LOCKED, then a compaction
>should not move memory. A MemDeref should be legal on a LOCKED pointer.
>
>Not only the built-in apps, but the ROM source code does it too.
I don't want to split hairs or be argumentative, but this isn't really the
right way to look at it. Given the current implementation of handles and
the unsupported, undocumented MemDeref, I think you're correct that it
should work in 3.2. But that doesn't mean you should call it, since
there's nothing to say a future OS release won't change this internal
behavior.
Also, the fact that the ROM does something doesn't mean it is right for
add-on software to do it - because when we change the implementation, we
can fix all the MemDeref callers at the same time.
>The particular need is... to get the offset into the handle that the
>field is using. The FieldType structure only has the handle, and the
>pointer to the memory being used. When the built-in ROM needs to grow
>memory, it does a MemDeref...
>I am going to change the code to do a lock and unlock to get the pointer.
Sounds like that's the right way to do it - a lock, pointer arithmetic, and
unlock. (Then presumably another unlock so you can grow the handle.)
>Since the built-in apps feel the need to deref a handle, and the ROM source
>needs to do it, there should be a legitimate API call to do it.
Well, not so much a "need" as convenience and a marginal (unmeasurable?)
performance gain, you'd have to admit. Sometimes there's lazy code which
hasn't been fixed yet. And we'd rather not have a bazillion convenience
APIs if there isn't significant benefit, since there's a nontrivial amount
of work associated with each new API in the system. Testing and
maintenance primarily, as well as having to guarantee it'll work forever.
(You probably already knew much of what I say here, Shannon, but not
everyone else on the list necessarily would.)
I'm still curious as to why the code would be failing in 3.2, since nothing
so far has given me a clue as to why the behavior would have changed (yet).
-David Fedor
Palm Developer Support