[gclist] Releasing symbols and sharing objects

Ken MacLeod ken@bitsko.slc.ut.us
15 Nov 2000 15:19:15 -0600


I have two situations that I'd like to hear how people handle them.
I'm using Boehm GC in C.

First, I have a symbol (or flyweight) table where I keep "one" copy of
each symbol as they are used or created.  Over time, most of the
symbols will be not referenced by any objects, except for the symbol
table itself.  How can I recognize this and free those symbols?

Second, I am interfacing my code in C with Perl (and eventually Python
and other languages) and sharing objects between the two runtimes.  My
current plan is to maintain a list of "Perl has a copy" pointer
references (to prevent them being released otherwise), and delete
these references when Perl deletes the Perl object.  Anybody have
experience with that, and does it work well?

Thanks,
  -- Ken