emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs-diffs Digest, Vol 19, Issue 62


From: Kim F. Storm
Subject: Re: Emacs-diffs Digest, Vol 19, Issue 62
Date: 12 Jul 2004 13:13:45 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Andreas Schwab <address@hidden> writes:

> address@hidden (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 <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]