[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: When are unused overlays garbage collected?
From: |
Marcin Borkowski |
Subject: |
Re: When are unused overlays garbage collected? |
Date: |
Thu, 27 May 2021 18:23:18 +0200 |
User-agent: |
mu4e 1.1.0; emacs 28.0.50 |
On 2021-05-26, at 14:34, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Marcin Borkowski <mbork@mbork.pl>
>> Date: Wed, 26 May 2021 07:01:48 +0200
>> Cc: help-gnu-emacs@gnu.org
>>
>> > Markers share some of their implementation with overlays, but because
>> > markers do not affect the display and because there is nothing
>> > corresponding to `overlays-at' or `overlays-in', Emacs goes through the
>> > trouble of GC'ing those markers which are still reachable via the
>> > buffer's internal variables (its list of markers) as long as they're not
>> > reachable some other way, of course.
>>
>> Thanks, too, this is pretty interesting. I assume one possible reason
>> for not having `markers-in' (analogous to `overlays-in') is that an
>> overlay (even without any variable pointing to it, IOW, a "name" for it)
>> has some "semantics" (properties), so it can be "guessed" what it is
>> for; for markers, we would only know that "someone wanted to remember
>> this position, but we have no idea why/what for", so why even bother
>> keeping it?
>
> I think we don't have markers-in because it isn't needed. overlays-in
> is needed when you want to find the next or the previous overlay, or
> when you need to know what faces contribute to the appearance of a
> character at certain position. There's no such need for markers.
Well, that obviously doesn't contradict what I was saying - but thanks
for the explanation (mine was of course just hypothesizing).
Best,
--
Marcin Borkowski
http://mbork.pl
Re: When are unused overlays garbage collected?, Stefan Monnier, 2021/05/24