From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Olavi Niemitalo To: Keisuke Nishida Cc: guile-emacs@sourceware.cygnus.com Subject: guile-emacs GC (was special forms) Date: Wed, 15 Mar 2000 11:37:00 -0000 Message-id: <873dpsauvn.fsf_-_@PC486.Niemitalo.LAN> References: <87n1o1p9kt.fsf@PC486.Niemitalo.LAN> X-SW-Source: 2000-q1/msg00016.html Kalle Olavi Niemitalo writes: > Besides I don't know enough about the Emacs garbage collector. The garbage collectors may be a larger problem than I thought... In guileapi.c, you have a list of Emacs Lisp objects which are being used by Guile. This protect_list prevents Emacs from garbage-collecting those objects and anything they point to. It is working fine (although lval_free() may get slow if the list is long). Now, if Emacs Lisp objects can also contain references to Guile objects, there must be a mechanism to prevent Guile from collecting those objects. One could perhaps add a similar list in the Guile side. If something causes a cycle of references between Lisp and Scheme, neither garbage collector can free the data. It's all locked down by the protect lists. To detect the situation, the garbage collectors would have to cooperate. I'm sure that would be a pain to code.