Paul Gargan wrote:
> my application is crashing when allocating memory using MemPtrNew
> - I get errors such as "Bus error exception [...] (PrvChunkNew)".
> I assume this means I'm out of dynamic memory? I thought MemPtrNew
> would at least "fail gracefully" and return NULL?
Right, it should always return NULL or non-NULL but not crash.
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.
> Further testing shows that MemHeapFreeBytes is also failing -
> "Bus error exception [...] (MemHeapFreeBytes)".
Yes, another clue suggesting you somehow trashed your heap.
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! :-)
-slj-