MSL "realloc" bug in CWPalmOS 8.3
Bug alert! Bug alert!
Here's a bug that escaped our code review in CW for Palm OS 8.3 when we fixed a problem with the realloc function. The file affected is "(MSL for Palm OS)\MSL_C++\MSL_Palm_OS\Include\cstdlib_Palm_OS".
In the definition of realloc, the last line of the code that handles the memErrChunkLocker error should be
return newPtr;
instead of
ptr = newPtr;
As currently implemented, if memory has to be reallocated, we will always immediately free the memory and return a NULL pointer. This is not what was intended, and we are sorry for the error.
Earlier versions of V8 didn't have this bug, but had a different bug in realloc that would affect almost any allocation.
Update: Core Wars for Palm OS
I was checking Palm Gaming World today, and I saw a new entry, PocketMARS. This is a freeware implementation of CoreWars for Palm OS, implementing multiple RedCode programs locked in battle. I've just downloaded the app, but haven't tried it out yet. Back in June, I wrote an article about this, so I'm pretty happy to see this appear.
Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.
The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

qwertYAK / frobnovich
|