>Right, it should always return NULL or non-NULL but not crash.
Thats what I figured.
>I'd guess your heap gets corrupted at some point prior to the crash,
>probably by writing outside the bounds of an allocated chunk or some
>other common error. This could toast the memory manager.
Yep ... with you so far ...
>> Further testing shows that MemHeapFreeBytes is also failing -
>> "Bus error exception [...] (MemHeapFreeBytes)".
>
>Yes, another clue suggesting you somehow trashed your heap.
Kinda obvious now, isn't it? :-)
Issuing a 'hd 0' on the debug console gives me a heap corrupt message so it
looks like I am trashing something somwhere. Now to try and find out what.
>But POSE is usually great at catching that kind of error when it
>happens. Do you have _all_ the memory checks enabled in the Debug
>Options dialog? If not, turn them all on and see what happens.
>
>(Or are you using a real Palm III? Always test on POSE! :-)
It's a real Palm I'm afraid. It needs to be initialised with data via the
serial port by a program running on the PC, so while I can download it to
POSE, I can't run it through the "suspect" code since there's no data there.
I defy anyone to find a null modem cable in Dublin at 6am on a Monday
morning! :-)
Hmm - yet another question: Could I upload an application database from the
Palm III to the PC and shove *it* into POSE? Would setting the back-up bit
on the databse and HotSyncing be enough?
Thanks for the swift reply,
Paul.