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: Paul Eggert
Subject: Re: Conservative GC isn't safe
Date: Sat, 26 Nov 2016 00:30:21 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/26/2016 12:11 AM, Daniel Colascione wrote:

1) mark_maybe_pointer looks only for exact matches on object start. It's perfectly legal for the compiler to keep an interior object pointer and discard the pointer to the object start.

Yes, just as it's perfectly legal for the compiler to subtract 42 from every pointer before putting it in a register or storing it into memory. In practice, though, compilers don't do this around calls to the garbage collector. (True, this assumption should be documented better.)


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.)



reply via email to

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