🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3711

Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)

#3711
From: Peter da Silva
Date: Mon, 08 Jan 1990 15:05
25 lines
2074 bytes
>    What I mean here is that you can allocate your block poimters, then call
>    map_fd to map the file into memory.

> The problem is that unless you copy the file on disk you can't back
> out of your edits at the last moment (:q! for vi people).  If you're
> going to copy the file you might as well copy it into vmem.

You misunderstand. I wasn't suggesting making direct edits on the memory
image. On the contrary, you map it in read-only if you can. What I was
suggesting was that since most of the things you're doing to the file don't
involve modifying it, you might as well page it in from disk when you
need it, only coping it to writable memory when you want to modify it.

For example, suppose you want to do a search and replace. You fault in
all the pages from here to the replacement location, copy the block that
contains the replacement into two new blocks (using the block-splitting
method) and add the new text. The blocks you just read can be discarded
when needed by the memory manager, rather than having to be written out
to the paging area, saving considerable disk access. Only modified blocks
would need to be written.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \ Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>
\_.--._/
      v  "Have you hugged your wolf today?" `-_-'
Technical Details
Message-ID: <94.639xds13@ficc.uu.net>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!bu.edu!bu-cs!snorkelwacker!apple!sun-barr!newstop!texsun!texbell!ficc!peter
References: <1558@aber-cs.UUCP> <129799@sun.Eng.Sun.COM> <50359@bbn.COM> <IN_S4Eggpc2@ficc.uu.net> <GUMBY.90Jan6045022@Gang-of-Four.Stanford.EDU> <2J+IH7ggpc2@ficc.uu.net> <GUMBY.90Jan7184250@Gang-of-Four.Stanford.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!bu.edu!bu-cs!snorkelwacker!apple!sun-barr!newstop!texsun!texbell!ficc!peter
From: peter@ficc.uu.net (Peter da Silva)
Newsgroups: comp.editors,gnu.emacs,comp.unix.wizards
Subject: Re: Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
Message-ID: <94.639xds13@ficc.uu.net>
Date: 8 Jan 90 15:05:53 GMT
References: <1558@aber-cs.UUCP> <129799@sun.Eng.Sun.COM> <50359@bbn.COM> <IN_S4Eggpc2@ficc.uu.net> <GUMBY.90Jan6045022@Gang-of-Four.Stanford.EDU> <2J+IH7ggpc2@ficc.uu.net> <GUMBY.90Jan7184250@Gang-of-Four.Stanford.EDU>
Reply-To: peter@ficc.uu.net (Peter da Silva)
Organization: Xenix Support, FICC
Lines: 20