[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Collecting markers with MPS (was: STatus of MPS branch)
From: |
Helmut Eller |
Subject: |
Collecting markers with MPS (was: STatus of MPS branch) |
Date: |
Wed, 24 Apr 2024 09:26:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
On Sat, Apr 20 2024, Gerd Möllmann wrote:
> - Figure out what is done in the old GC in garbage_collect that is not
> directly related to GC, and how to do that when GC is concurrent.
> Examples are buffer undo_list, window prev_buffers/next_buffers
In the igc branch, markers are currently not collected because they are
referenced from the buffer's chain of markers. The old GC has special
code to break this link. There is also special code to break links from
the undo-list to markers.
With the MPS, we could introduce explicit weak reference objects,
similar to WeakRef in Javascript[*]. Buffers would then, instead of the
current chain of markers, have a list of weak references to markers.
(Markers would no longer have the embedded "next" field.) The same for
the undo-list: instead of markers, it would contain weak references to
markers.
This would allow markers to be collected, but the empty weak-ref objects
would still be in the undo-list and the buffer's markers-list. A timer
could periodically go through those lists and remove the empty
weak-refs.
Does this sound like a reasonable plan? To me, it sounds like it will
require relatively big changes to the buffer code. Much bigger than the
200 or so lines of special code in the old GC. Also, the undo-list is
visible to Lisp code, so those weak reference objects in there must be
new types of Lisp objects.
On the plus side, explicit weak reference objects could make some things
easier to understand and might be more widely useful to Lisp
programmers.
What do you think? Is there an more elegant alternative?
Helmut
[*]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef
- Re: MPS signals and Emacs, (continued)
- Re: MPS signals and Emacs, Helmut Eller, 2024/04/22
- Re: MPS signals and Emacs, Eli Zaretskii, 2024/04/22
- Re: MPS signals and Emacs, Paul Eggert, 2024/04/22
- Re: MPS signals and Emacs, Eli Zaretskii, 2024/04/23
- Re: STatus of MPS branch, Gerd Möllmann, 2024/04/22
- Re: STatus of MPS branch, Gerd Möllmann, 2024/04/22
- Re: STatus of MPS branch, Helmut Eller, 2024/04/22
- Re: STatus of MPS branch, Gerd Möllmann, 2024/04/22
Collecting markers with MPS (was: STatus of MPS branch),
Helmut Eller <=
- Re: Collecting markers with MPS (was: STatus of MPS branch), Eli Zaretskii, 2024/04/24
- Re: Collecting markers with MPS, Helmut Eller, 2024/04/24
- Re: Collecting markers with MPS, Gerd Möllmann, 2024/04/24
- Re: Collecting markers with MPS, Eli Zaretskii, 2024/04/24
- Re: Collecting markers with MPS, Gerd Möllmann, 2024/04/24
- Re: Collecting markers with MPS, Gerd Möllmann, 2024/04/24
- Re: Collecting markers with MPS, Eli Zaretskii, 2024/04/24
- Re: Collecting markers with MPS, Gerd Möllmann, 2024/04/24
Re: Collecting markers with MPS, Helmut Eller, 2024/04/24
Re: Collecting markers with MPS, Eli Zaretskii, 2024/04/24