emacs-devel
[Top][All Lists]
Advanced

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

Re: Conservative GC isn't safe


From: Ken Raeburn
Subject: Re: Conservative GC isn't safe
Date: Mon, 28 Nov 2016 14:09:44 -0500

> On Nov 28, 2016, at 12:37, Eli Zaretskii <address@hidden> wrote:
> 
>> From: Stefan Monnier <address@hidden>
>> Cc: Ken Raeburn <address@hidden>,  address@hidden,  address@hidden
>> Date: Mon, 28 Nov 2016 11:15:28 -0500
>> 
>>>> res = Fvector (ito - ifrom, aref_addr (string, ifrom));
>>> But 'string' still references the contents array of the vector, so GC
>>> will mark it when it comes to 'string'.
>> 
>> But after computing "aref_addr (string, ifrom)", it may very well be
>> that `string` is dead and the compiler may then decide not to write
>> it into the stack.
> 
> It will still be there in the caller.

Not if Fsubstring (or whatever function) is applied directly to the return 
value from some other call.  As Björn described, the caller may not keep it 
around at all, just shift it from register to register, and the callee can 
scribble over those registers.  Even if there’s an automatic variable assigned 
the value, if it’s not used later, the compiler may optimize it away; I’ve lost 
track of how many times GDB has indicated to me that it recognizes a variable 
name but at the current point in the code it’s been optimized out so GDB can’t 
show it to me.


reply via email to

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