From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Question about GC in C code. Date: Tue, 12 Nov 2002 14:44:43 -0500 Sender: emacs-devel-admin@gnu.org Message-ID: <200211121944.gACJih708562@rum.cs.yale.edu> References: <200211121246.gACCk0MU030988@stubby.bodenonline.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037201531 23637 80.91.224.249 (13 Nov 2002 15:32:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 13 Nov 2002 15:32:11 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18BzCO-00045j-00 for ; Wed, 13 Nov 2002 16:13:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18BzOL-00066k-00 for ; Wed, 13 Nov 2002 16:25:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18BhD7-0001DD-00; Tue, 12 Nov 2002 15:00:33 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18Bgxy-0004ZN-00 for emacs-devel@gnu.org; Tue, 12 Nov 2002 14:44:54 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18Bgxu-0004YC-00 for emacs-devel@gnu.org; Tue, 12 Nov 2002 14:44:53 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18Bgxq-0004VT-00; Tue, 12 Nov 2002 14:44:46 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id gACJih708562; Tue, 12 Nov 2002 14:44:43 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: "Jan D." Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9376 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9376 > How about if alloc.c was modified so other code could register a function > to be called when GC occurs? That function could then mark lisp > objects as needed. That way we can keep alloc.c free from knowing all > the details of data structures, and changes to those data structures > can be localized in just one file. Something like this: Usually what happens instead is that code tries to fit all the data it needs to manipulate within a Lisp_Object data structure, so you don't need any new mark routine, but you just need to register a few more roots (if anything at all). E.g. instead of using a C struct, you can use a Lisp vector. Stefan