From: Grzegorz J. <ja...@he...> - 2003-02-18 01:05:38
|
On 2003-02-14 Stefan Reuther wrote: > 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. It does, but you have to use custom allocator. There are headers for that somewhere in GC distribution. I was using it in 'exp_templates' branch. Or if you do not want to bother GC with container memory, just write wrapper for plain pointers and use the wrapper when storing elements in a container. [...] > > 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. Unfortunately you are absolutely right. Best regards Grzegorz FYI: The original posting of your e-mail somehow did not make it to my mailbox. ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |