unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* When are unused overlays garbage collected?
@ 2021-05-24  5:00 Marcin Borkowski
  2021-05-24  5:05 ` Emanuel Berg via Users list for the GNU Emacs text editor
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Marcin Borkowski @ 2021-05-24  5:00 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

the Elisp reference says that the `delete-overlay' function does not
entirely delete the overlay (in a sense):

--8<---------------cut here---------------start------------->8---
The overlay continues to exist as a Lisp object, and its property list
is unchanged, but it ceases to be attached to the buffer it belonged to,
and ceases to have any effect on display.

A deleted overlay is not permanently disconnected.  You can give it
a position in a buffer again by calling ‘move-overlay’.
--8<---------------cut here---------------end--------------->8---

So I assume that if I `delete-overlay', it means it cannot be
necessarily garbage-collected yet.  So, when /can/ an overlay be really
"deleted", meaning the memory it occupied is freed?

My guess would be that if the overlay is "deleted" (so it is not
attached to any buffer, either by means of `delete-overlay' or when its
buffer is killed) /and/ it can't be referenced from Elisp (e.g., there
is no variable bound to it).  This would make sense, because even if
there is no variable bound to an overlay which is not deleted, you can
still get a reference to it using any of the overlay-finding functions
(`overlays-at' or `overlays-in').

Am I correct?

--
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-05-28 19:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24  5:00 When are unused overlays garbage collected? Marcin Borkowski
2021-05-24  5:05 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-24  6:33   ` Marcin Borkowski
2021-05-24 12:27 ` Eli Zaretskii
2021-05-26  4:53   ` Marcin Borkowski
2021-05-26  7:23     ` tomas
2021-05-26 15:36       ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-26 16:52         ` tomas
2021-05-26 12:30     ` Eli Zaretskii
2021-05-27 16:20       ` Marcin Borkowski
2021-05-27 16:41         ` Eli Zaretskii
2021-05-28 19:38           ` Marcin Borkowski
2021-05-24 17:07 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-26  5:01   ` Marcin Borkowski
2021-05-26 12:34     ` Eli Zaretskii
2021-05-27 16:23       ` Marcin Borkowski
2021-05-26 14:48     ` Stefan Monnier
2021-05-27 16:26       ` Marcin Borkowski
2021-05-27 21:42         ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).