[Top][All Lists]

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

Re: Conservative GC isn't safe

From: Eli Zaretskii
Subject: Re: Conservative GC isn't safe
Date: Sat, 26 Nov 2016 17:12:36 +0200

> From: Stefan Monnier <address@hidden>
> Date: Sat, 26 Nov 2016 10:03:39 -0500
> >> 2) INTERVAL is GCed, but it's not represented in the memory tree: struct
> >> interval isn't a real lisp object and it's allocated as
> >> MEM_TYPE_NON_LISP. Even a direct pointer to the start of an interval won't
> >> protect it from GC. Shouldn't we treat intervals like conses?
> > Does the code ever create an interval that is accessible only via locals
> > when a GC occurs? If not, Emacs should be OK. (This should also be
> > documented better.)
> Indeed, this is a fairly delicate assumption that we don't check.
> It's fairly rare to manipulate "struct interval" directly, so I think
> the assumption is probably acceptable, but we should maybe document it
> more prominently.

Documentation aspects aside, if by "manipulate struct interval" you
mean what we do in intervals.c between the call to make_interval and
the return value being plugged into some Lisp object, either a buffer
or a string, then we could set a variable during that time, which
would cause an abort in GC, if that happens somehow.

Would that address these concerns?  If not, what kind of direct
manipulations with intervals did you have in mind?

reply via email to

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