From: Stefan R. <sr...@ma...> - 2003-02-14 11:42:51
|
Hello, On Fri, Feb 14, 2003 at 09:44:39AM +0800, Grzegorz Jakacki wrote: > On Thu, 13 Feb 2003, Alexandre Tolmos wrote: > > I would like to use OpenC++ on MacOs X. Compiling occ itself shouldn't > > be a big issue (Darwin, the core Os is FreeBSD based) but the garbage > > collector is Os and architecture dependent. So, my questions are: > > > > - Is there a Mosx port of GC? > > It seems to me that recent versions of Hans Boehm's GC supports MacOS X. [...] > Try to build with one of them and let me know if it works. MacOS X port > of OpenC++ would be very welcome. JFTR: I have built OpenC++ with a different GC than the included one. Here's what I did: + clear the "gc" subdirectory from the OpenC++ source tree + install the garbage collector into that directory + symlink all files from "gc/include" into "gc". OpenC++ wants to say "#include <gc/gc.h>". The versions I tried were GC 6.1 and OpenC++ 2.5.12; I still have to try the CVS version. The reason why I replaced the GC was because my program crashed and I suspected a GC bug. Later, it turned out that the GC doesn't trace STL containers for pointers. The solution so far is to compile the GC with "-DREDIRECT_MALLOC=GC_malloc_uncollectable" (overloading ::operator new didn't seem to do the trick). Just in case someone else also stumbles across that problem... > PS: If this does not work, however, there is possibly a way to get rid of > GC at all with help of boost::shared_ptr<>. Uhm. I doubt that. At least, this fundamental piece of Ptree union { struct { Ptree* child; Ptree* next; } nonleaf; struct { char* position; int length; } leaf; }data; will not compile when replacing Ptree* by boost::shared_ptr<Ptree>. So you'd have to rewrite quite a lot, I think. Stefan |