emacs-devel
[Top][All Lists]
Advanced

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

Re: New GC concept


From: Eli Zaretskii
Subject: Re: New GC concept
Date: Tue, 22 Jun 2021 15:59:16 +0300

> Cc: emacs-devel@gnu.org
> From: Daniel Colascione <dancol@dancol.org>
> Date: Mon, 21 Jun 2021 15:58:20 -0700
> 
> > 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?

The DPMI provider which comes with DJGPP supports DPMI 0.9 with some
extensions.  (If one runs a DJGPP program on MS-Windows, one gets what
Windows provides instead, which is DPMI 0.9.)

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

Yes, this is supported.

> 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

DJGPP has mprotect.  It indeed requires DPMI 1.0, but it is also one
of the extensions supported by the DPMI provider that comes with
DJGPP.

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

Right, this requires DPMI 1.0.

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

Yes, definitely.



reply via email to

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