unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Emacs-diffs Digest, Vol 19, Issue 62
Date: 12 Jul 2004 13:13:45 +0200	[thread overview]
Message-ID: <m3acy5mqae.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <jey8lp4k01.fsf@sykes.suse.de>

Andreas Schwab <schwab@suse.de> 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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2004-07-12 11:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1BcnjN-0005AC-0I@monty-python.gnu.org>
     [not found] ` <E1BdKWZ-0004NI-3s@fencepost.gnu.org>
2004-06-24  7:55   ` Emacs-diffs Digest, Vol 19, Issue 62 Kim F. Storm
2004-06-24  8:50     ` Kim F. Storm
2004-06-30 12:09       ` Andreas Schwab
2004-07-06 23:50         ` Andreas Schwab
2004-07-12  9:34           ` Kim F. Storm
2004-07-12 10:06             ` Andreas Schwab
2004-07-12 11:13               ` Kim F. Storm [this message]
2004-07-12 11:39                 ` Andreas Schwab
2004-07-12 13:12                   ` Kim F. Storm
2004-07-12 13:25                     ` Andreas Schwab
2004-07-12 13:13                   ` Kim F. Storm
2004-07-12 13:26                     ` Andreas Schwab
2004-07-12 14:23                       ` Kim F. Storm
2004-06-25  6:28     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3acy5mqae.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).