On Mon, 29 Nov 2004 12:40:17 -0800, Sean Chittenden <[EMAIL PROTECTED]> wrote: > > > >> Ilja, howabout it: can we start using gc in the codebase starting at > >> 2.0.2? > > > > I missed a couple of messages on the list: I missed redirecting calloc > > en realloc to GC which made dbmail-smtp barf. > > > > Ilja, > > > > mixing glib's allocation with gc is indeed an issue with the 2.1 > > codebase, but *not* for 2.0. But fixing the double-frees and looping > > imap are critical and gc just helps spotting the trouble spot real > > easy.
True. For 2.0.2, this would be nice. On last thing, is libgc in all major distros (including FreeBSD)? > > > > Perhaps there's an easy solution to gc and glib out there. And no, > > expecting users to compile their own glib is not an option. > > > > Sean, any suggestions? > > Doesn't glib have the ability to specify its allocation/free routines? > For instance, in libmemcache(3), I allow the user to specify their > allocation/deallocation routines. In pgmemcache, I then set those > functions before using any of libmemcache(3), that way libmemcache(3) > uses PostgreSQL's memory management routines. See: > > http://people.FreeBSD.org/~seanc/libmemcache/libmemcache.c > http://people.FreeBSD.org/~seanc/pgmemcache/pgmemcache.c > > The routines to look for are: > > mcMemSetup() > mcGetSetup() > > Many APIs let you do this that way you can embed libraries into > programming languages. I would be surprised if glib didn't let you do > the same. All said, it should take no more than about 10 lines of code > to accomplish the task of unifying the memory allocation to be > completely handled by GC. -sc If this is possible, I'm all for it. GC will make it easier for us and will let us concentrate on the interesting parts.