From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Emacs-diffs Digest, Vol 19, Issue 62 Date: 12 Jul 2004 13:13:45 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1089630815 4363 80.91.224.253 (12 Jul 2004 11:13:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Jul 2004 11:13:35 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Jul 12 13:13:27 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BjykR-0006Xx-00 for ; Mon, 12 Jul 2004 13:13:27 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BjykQ-0000LB-00 for ; Mon, 12 Jul 2004 13:13:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bjymk-0007hE-Es for emacs-devel@quimby.gnus.org; Mon, 12 Jul 2004 07:15:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bjymg-0007gz-0r for emacs-devel@gnu.org; Mon, 12 Jul 2004 07:15:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bjyme-0007gn-CU for emacs-devel@gnu.org; Mon, 12 Jul 2004 07:15:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bjyme-0007gk-7T for emacs-devel@gnu.org; Mon, 12 Jul 2004 07:15:44 -0400 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.34) id 1BjykE-0000N9-Cz for emacs-devel@gnu.org; Mon, 12 Jul 2004 07:13:14 -0400 Original-Received: (qmail 20085 invoked from network); 12 Jul 2004 11:13:13 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 12 Jul 2004 11:13:13 -0000 Original-To: Andreas Schwab In-Reply-To: Original-Lines: 40 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25609 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25609 Andreas Schwab writes: > storm@cua.dk (Kim F. Storm) writes: > > > Does this patch work? > > > > *** alloc.c 23 Jun 2004 10:30:52 +0200 1.346 > > --- alloc.c 12 Jul 2004 11:29:19 +0200 > > *************** > > *** 5033,5038 **** > > --- 5033,5039 ---- > > break; > > > > case Lisp_Misc_Save_Value: > > + #if GC_MARK_STACK > > { > > register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); > > /* If DOGC is set, POINTER is the address of a memory > > *************** > > *** 5045,5050 **** > > --- 5046,5052 ---- > > mark_maybe_object (*p); > > Do you actually need mark_maybe_object? Wouldn't mark_object be ok, given > that any use of SAVE_ALLOCA_LISP has to initialize the array anyway? The array is _not_ initialized, it is filled in gradually, and GC may occur in-between. So mark_maybe_object is the right thing to use. If you look at how traditional GCPRO is done at the places that use those arrays, you will see that GC gradually modifies the gc data as the array elements are filled in. Since the array allocated by SAVE_ALLOCA_LISP is usually allocated on the stack with alloca, it's elements are usually processed by mark_maybe_object if MARK_STACK. So it's the right thing to use mark_maybe_object also when the array is allocated on the heap. -- Kim F. Storm http://www.cua.dk