unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Eli Zaretskii <eliz@gnu.org>, Daniele Nicolodi <daniele@grinta.net>
Cc: emacs-devel@gnu.org
Subject: Re: New GC concept
Date: Mon, 21 Jun 2021 15:58:20 -0700	[thread overview]
Message-ID: <10670fe2-0c84-1990-b67b-b1f2215e17cb@dancol.org> (raw)
In-Reply-To: <83k0n5f630.fsf@gnu.org>

On 6/7/21 7:22 PM, Eli Zaretskii wrote:
>> From: Daniele Nicolodi <daniele@grinta.net>
>> Date: Mon, 7 Jun 2021 21:51:45 +0200
>>
>>> We can definitely replace the existing GC with the new GC everywhere.
>>> I've designed the new GC to work on systems without virtual memory
>>> facilities. On these systems, we'll have to run the GC in
>>> non-concurrent, non-generational mode, but that's no regression from
>>> what we have today. We'll also probably want to use a smaller block size
>>> on these systems to reduce fragmentation overhead.
>> Isn't DOS the only system in this class? (It is not a rhetorical
>> question: a while ago I asked which systems are officially supports and
>> the answer was that all systems that currently run Emacs are supported).
>>
>> Does it make sense to still support DOS?
> The development environment which is used to build the MS-DOS port of
> Emacs (DJGPP) does support virtual memory (IIUC what that means in
> this context).

Oh, right. I completely forgot that we have DPMI.

It's been a very long time since I looked at that. Does DJGPP provide 
DPMI 0.9 or 1.0?

To get generational GC under DJGPP, we'll need something like a SIGSEGV 
handler, a bit of code that we run when the CPU signals a memory 
protection fault. I think we get there by installing an exception 
interrupt handler, as in 
http://www.delorie.com/djgpp/doc/dpmi/ch4.5.html, and I think it'll work 
in both DPMI 0.9 and 1.0. Another thing we need for generational GC is 
the ability to mark a range of pages read-only, as with mprotect. I 
think DPMI gives us the ability to change page permissions, but 0.9 does 
not. See http://www.delorie.com/djgpp/doc/dpmi/api/310507.html

The other thing we get with VM is the ability to swap the from-space and 
the to-space without an additional memory copy. DPMI 1.0 appears to 
provide a shared memory facility that would let us do that (the 
equivalent of mmap/MapViewOfFile of an anonymous segment), but I'm not 
sure that DPMI 0.9 gives us that ability.

Anyway, even if it is theoretically possible to implement the new GC's 
fancy VM stuff in terms of DPMI, I think it should have lower priority 
than the rest of the system. The new GC run without virtual memory use 
at all should still be no worse overall than the current GC, so MS-DOS 
Emacs at least wouldn't see a regression if we switched to a version of 
the new GC that didn't understand DPMI.

But DPMI support for the new GC would definitely be a fun retro 
computing project.




  reply	other threads:[~2021-06-21 22:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04  3:30 New GC concept Daniel Colascione
2021-06-04  8:00 ` Daniel Mendler
2021-06-04  9:47   ` Daniel Colascione
2021-06-04 10:50     ` Eli Zaretskii
2021-06-21 13:00       ` Fejfighter
2021-06-21 13:31         ` Eli Zaretskii
2021-06-21 22:43         ` Daniel Colascione
2021-07-24 13:39           ` Fejfighter
2021-06-04 11:06     ` Daniel Mendler
2021-06-04  8:56 ` Andrea Corallo via Emacs development discussions.
2021-06-07 17:32 ` Matt Armstrong
2021-06-07 18:03   ` Daniel Colascione
2021-06-07 19:51     ` Daniele Nicolodi
2021-06-08  2:22       ` Eli Zaretskii
2021-06-21 22:58         ` Daniel Colascione [this message]
2021-06-22 12:59           ` Eli Zaretskii

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=10670fe2-0c84-1990-b67b-b1f2215e17cb@dancol.org \
    --to=dancol@dancol.org \
    --cc=daniele@grinta.net \
    --cc=eliz@gnu.org \
    --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).