Xref: utzoo comp.editors:1248 gnu.emacs:2106 comp.unix.wizards:20054 Path: 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> <2J+IH7ggpc2@ficc.uu.net> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 20 > 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. . / \ Also or \_.--._/ v "Have you hugged your wolf today?" `-_-'