>I was referring to POSE warnings that pop up because of bugs in the OS. If I
>do not use memory manager calls in a particular part of code,
>yet receive warnings about directly accessing memory manager data
>structures, it's obviously a problem in the OS or in POSE.

No, it isn't.  You'll get those warnings if you're just using a pointer of
your own and read too far, or if you use too high of an index in an array,
or string... you don't need to be anywhere near Memory Manager APIs.

(Background info, which you might know but perhaps others don't: when you
ask to allocate N bytes of memory, the memory manager allocates N+8 or so,
and puts at the chunk's start a few bytes of information like who owns the
memory chunk and how big it is.  Then it returns you a pointer to the start
plus 8 bytes or whatever it is.  So if you access element -1 in an array,
you're reading the memory manager's structures.  Similarly, if you read or
write too far, you're likely to land on the memory manager's data for the
chunk that falls next in memory.)

Pose doesn't know whose fault it is.  That's your job as the developer, in
debugging the situation.  There are very few places in the OS where it
might do something wrong without provocation... and ignoring the messenger
isn't wise.  It is a useful warning that something is going wrong; don't
ignore it!

Besides, we run the rom under pose all the time, and if pose complains
about something it will get fixed pretty quickly.  So there are few obvious
bad-pointer bugs like this in current roms.


>Besides I'm still not convinced that memory manager data structures are
>particularly subject to change.

They absolutely are.  We changed them between 3.0 and 3.1, I'm fairly sure,
and then again in either 3.3 or 3.5, or both.  Subtle changes that improved
efficiency, and which people don't talk about much because they don't
affect anyone except folks working on the Memory Manager!


>What about all the other internal structures
>that are revealed in the API? Should POSE warn about these as well?

Probably it should, for many of them.  It is technically hard for it to do
so without slowing down the emulation a lot, though.  Watching the memory
manager structs is probably the most important, though, and the easiest for
an app to do accidentally.

In short, yes everything has bugs, and Pose is great at pointing them out.
Assuming the problem is always someone else's, without checking it out
first, isn't advisable.

-David Fedor
Palm Developer Support



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to