Runtime bugs for operator new
If you're using operator new, and you're getting tight on memory, you may hit a bug in the Palm OS runtime library with V8 that just recently got reported to me.
There are two problems with new.cp, as included in the 8.2 runtime, one that's been there for a long time, and one that was added in V8.
First, new isn't behaving correctly for allocations of 0 bytes. Normally, you can't allocate nothing, but its actually possible to try to new an array of zero objects. Rather than allowing this, new was crashing the device inside MemPtrNew. To fix this, just remove the #ifdef section around the check for zero bytes at the beginning of the operator new code. This bugs been in the runtime since at least version 6.
The new one is a cute beast, gone undetected due to C/C++'s expression rules. There is a line in operator new that gets executed when an allocation fails that looks like "features->new_handler". The bug is that there's no "()" after this, so its just a reference to the value of new_handler, not a call to it. Because of this, if you run out of memory and you had a new_handler setup, you would go into an infinite loop. Not pretty!
Thanks to Greg Lutz for reporting these problems. I've fixed them both for an upcoming 8.3 patch, but I wanted to let everyone know about them now in case you wanted to fix them yourself.
CodeWarrior for Mac OS/Windows 8 Shipping Soon
Its exciting around Metrowerks right now because Pro 8, our toolset for Mac OS and Windows, is about to ship a new version. New versions of Pro usually come with new versions of the CodeWarrior IDE, and this is no exception.
Our current Palm OS tools have mixed results when used with IDE 5. The compiler and linker both work just fine, although the new C/C++ Compiler pref panel might not work properly with every setting. The debugger won't work due to changes in the debugger interface, and the wizards won't work due to their usage of IDE DLL files that have changed in IDE 5.
We're not planning on releasing IDE 5-compatible versions of these components until the V9 toolset is released this fall. You can run both the 4.2.5 and 5.0 IDEs on the same machine if installed in different directories, so we recommend doing that until we can deliver a mergable toolset.
Back to Pro 8: I'm really excited about the new Win32 features. We finally have MFC 6 and ATL 3 support, code completion for C++ and Java works pretty well, the new MDI mode with docking windows is great, and the new C/C++ compiler front-end has really improved out ISO C++ compliance while adding more C99 features to the language. The Mac OS X features are very cool too, but I'm not a real Mac Head, so I'm not going to pay a lot of attention to them until I get back into Mac coding for CW Palm OS V9.

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
|