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.

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

--
Sean Chittenden

Reply via email to