[Top][All Lists]

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

Re: Conservative GC isn't safe

From: Daniel Colascione
Subject: Re: Conservative GC isn't safe
Date: Mon, 28 Nov 2016 10:03:49 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/28/2016 10:00 AM, Eli Zaretskii wrote:
From: Daniel Colascione <address@hidden>
Date: Mon, 28 Nov 2016 09:51:37 -0800

struct foo* f = something();
int* x = f->&field;
something_else(); // invalidate global memory
*x = 5; // f is dead here, but still in scope

Even if you don't write this kind of code, the compiler is allowed to
generate it.

But there's no such code in Emacs, and will never be.

I think you have too little faith in the ingenuity of compiler writers. Why can't the compiler generate this sort of code in cases we don't anticipate?

Lisp objects we
create are either temporaries that can be GC'ed, or values that cannot
be GC'ed, in which case they are passed to some other code, either a
callee or returned as a value.  The only ones that can be dead as
above are the first variety, about which we don't care.

When this assumption stops holding, it's going to be very difficult to debug the resulting occasional crashes. Wouldn't it be easier to use the information *already in the memory tree* to make GC more conservative and understand interior pointers?

reply via email to

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