unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Emacs Devel <emacs-devel@gnu.org>
Cc: Eli Zaretskii <eliz@gnu.org>, Helmut Eller <eller.helmut@gmail.com>
Subject: MPS: struct window, prev_buffers + next_buffers
Date: Sat, 22 Jun 2024 09:24:59 +0200	[thread overview]
Message-ID: <m2tthl4eyc.fsf@pro2.fritz.box> (raw)

I have some questions about the handling of window::prev_buffers and
next_buffers. These are handled in the existing GC in this function in
alloc.c:

  /* Remove killed buffers or items whose car is a killed buffer from
     LIST, and mark other items.  Return changed LIST, which is marked.  */

  static Lisp_Object
  mark_discard_killed_buffers (Lisp_Object list)
  {
    Lisp_Object tail, *prev = &list;

    for (tail = list; CONSP (tail) && !cons_marked_p (XCONS (tail));
         tail = XCDR (tail))
      {
        Lisp_Object tem = XCAR (tail);
        if (CONSP (tem))
          tem = XCAR (tem);
        if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem)))
          *prev = XCDR (tail);
        else
          {
            set_cons_marked (XCONS (tail));
            mark_object (XCAR (tail));
            prev = xcdr_addr (tail);
          }
      }
    mark_object (tail);
    return list;
  }

IGC must do something with these lists, too, I guess.

Some questions:

1. Does igc really have to do something? I don't see something
noticeably growing, even after hours of using Emacs with igc.

2. Is it an option to leaving these lists alone in GC?

3. If igc should do something, how frequently? IOW what makes these
lists grow? And perhaps could we do this cleanup where new entries are
pushed onto them?

4. Note that the loop in the function stops when a cons cell is marked.
So it doesn't always take entries off the list that contain dead
buffers. I don't understand that at all.

TIA



             reply	other threads:[~2024-06-22  7:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-22  7:24 Gerd Möllmann [this message]
2024-06-22  7:58 ` MPS: struct window, prev_buffers + next_buffers Eli Zaretskii
2024-06-22  8:13   ` Gerd Möllmann
2024-06-22  8:24     ` Eli Zaretskii
2024-06-22  8:53       ` Gerd Möllmann
2024-06-22  9:50         ` Eli Zaretskii
2024-06-22 10:25           ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2tthl4eyc.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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