[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: |
Sun, 27 Nov 2016 17:39:44 +0200 |
> From: Ken Raeburn <address@hidden>
> Date: Sun, 27 Nov 2016 01:17:54 -0500
> Cc: address@hidden
>
> > Indeed. Hans Boehm's done a fair bit of research in this issue,
> > including discussing the underlying assumptions and arguing that
> > compilers should (and usually do) guarantee those assumptions.
>
> I’d be surprised if that held reliably when the last use of a Lisp_Object in
> some function extracts an object pointer and then never references the
> Lisp_Object as such ever again.
>
> Lisp_Object foo (Lisp_Object obj)
> {
> …
> return mumble (XSYMBOL (obj));
> }
>
> It’s got no reason to specifically obfuscate the value, but it may also have
> no reason to keep a copy of the Lisp_Object value around when it’s no longer
> needed. It’s not so much that the compiler has decided to start using an
> interior pointer on its own, but instead just doing what we told it to do.
> If “mumble” triggers GC, stack marking may well find only the pointer and not
> the original “obj” value in this function, especially if the compiler
> optimizes away the stack frame of “foo” completely.
IOW, you envision the possibility that the object identified by 'obj'
is not held in any stack-based memory cell in any of the 'foo's
callers, and instead all of them hold that object only in registers?
Is that a reasonable assumption?
Re: Conservative GC isn't safe, Stefan Monnier, 2016/11/26
Re: Conservative GC isn't safe, Ken Raeburn, 2016/11/27
Re: Conservative GC isn't safe,
Eli Zaretskii <=
Re: Conservative GC isn't safe, Ken Raeburn, 2016/11/28
Re: Conservative GC isn't safe, Eli Zaretskii, 2016/11/28
Re: Conservative GC isn't safe, Paul Eggert, 2016/11/27
Re: Conservative GC isn't safe, Ken Raeburn, 2016/11/28
Re: Conservative GC isn't safe, Eli Zaretskii, 2016/11/28
Re: Conservative GC isn't safe, Björn Lindqvist, 2016/11/28
Re: Conservative GC isn't safe, Stefan Monnier, 2016/11/28
Re: Conservative GC isn't safe, Eli Zaretskii, 2016/11/28
Re: Conservative GC isn't safe, Stefan Monnier, 2016/11/28
Re: Conservative GC isn't safe, Eli Zaretskii, 2016/11/28