Mach and faulting in the file (Re: GNU Emacs, memory usage, releasing)
David Vinayak Wallace
gumby at Gang-of-Four.Stanford.EDU
Mon Jan 8 13:42:50 AEST 1990
Date: 7 Jan 90 20:05:37 GMT
From: peter at ficc.uu.net (Peter da Silva)
What I mean here is that you can allocate your block poimters, then call
map_fd to map the file into memory. Now you point your block pointers into
the file, but don't actually touch the 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.
> 3> Allow the program to change the page mapping
THAT is the thing to do to "fix" buffer gap. If you can do that you can also
call map_fd to get the initial buffer. The problem with this is that now
the program (or its custom external pager) is having to do much of the work
of a block-splitting algorithm.
malloc already does most of the required work. You could add a system
call or system macro to tell you how to xlate a page index from a
pointer and bingo.
More information about the Comp.unix.wizards
mailing list