emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scratch/igc: Implications of MPS being asynchronous


From: Gerd Möllmann
Subject: Re: scratch/igc: Implications of MPS being asynchronous
Date: Mon, 13 Jan 2025 14:21:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  pipcet@protonmail.com,
>>   emacs-devel@gnu.org,  gerd@gnu.org,  eller.helmut@gmail.com
>> Date: Mon, 13 Jan 2025 05:09:00 +0100
>> 
>> Stefan Kangas <stefankangas@gmail.com> writes:
>> 
>> > Eli Zaretskii <eliz@gnu.org> writes:
>> >
>> >>> From: Stefan Kangas <stefankangas@gmail.com>
>> >>> Date: Sun, 12 Jan 2025 16:55:54 +0000
>> >>> Cc: pipcet@protonmail.com, emacs-devel@gnu.org, gerd@gnu.org,
>> >>>  eller.helmut@gmail.com
>> >>>
>> >>> (IMHO, the code organization is a bit funny here, because
>> >>> garbage_collect() doesn't do what it says on the tin.  I don't think
>> >>> it's worth addressing that right now though.  Maybe it's worth taking a
>> >>> second look after merging.)
>> >>
>> >> If we want to add igc_collect somewhere which is called by
>> >> garbage-collect, we should add it to garbage_collect, because what you
>> >> call "funny" here is quite confusing.  Are there any good reasons not
>> >> to call igc_collect from garbage_collect?
>> >
>> > AFAIU, MPS should decide when to GC, not maybe_gc.
>> 
>> Maybe I'm misunderstanding something and I haven't read all my mails
>> yet, but if this is about calling igc_collect (= mps_arena_collect) in
>> some regular code path, I find that a very bad idea. It works against
>> MPS as a incremental + generational GC.
>
> Your opinion is that Emacs will never want to intentionally trigger GC
> from Lisp?  Can you explain why not?  We do this with the current GC
> quite a lot.

Here's what MPS says about mps_arena_collect in a note

  It is not normally necessary to call this function: in the unclamped
  state, collections start automatically. However, it may be useful during
  development and debugging: the more frequently the collector runs, the
  sooner and more reliably errors are discovered. See General debugging
  advice.

There are only rare situations in which I'd use igc--collect from Lisp,
igc-stats being an example.

Secondly I think offering garbage-collect gives the false impression
that it has the same semantics in old and new GC. How would one make
sure that existing calls to garbage-collect made for the old gC are
the right thing for igc?



reply via email to

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