Chalk One Up For Experience
One thing that I’d found in the past is that developing on the Win32 platform has benefits of its own. For one thing, the compiler, linker and OS in general are pickier. There are also some things that aren’t readily obvious.
Before I explain, I have to state up front that the Tools library has been built on Win32, backported to Linux and just about fully tested on both platforms. The areas that need to be tested on Win32 are the LibHandle, PlugIn and PlugInMgr code. On Linux, I wrote some special test code to build the shared library that these tests require. I need to port that code to Win32 and make it part of the development environment.
Anyway, one particular difference between the Linux and Win32 environments is the memory allocator. Linux will clear the allocated memory, set each byte to 0×00. Win32 will not. Code that worked on Linux didn’t work on Win32 because it had been assumed that the allocated memory had been cleared. I usually don’t rely on such assumptions, preferring to write cross-platform up front to ease any downstream porting issues, but I had neglected to clear out allocated memory in my IntX class. I had properly handled reallocations, but not fresh allocations. After adding the appropriate two lines of code, it all worked just fine.
Now, do I work on the Ruby -> C++ library interface or port the Compression library?