help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: opening large files (few hundred meg)


From: Ilya Zakharevich
Subject: Re: opening large files (few hundred meg)
Date: Thu, 31 Jan 2008 22:55:06 +0000 (UTC)
User-agent: trn [how to get a version via %-escapes???] with a custom header

[A complimentary Cc of this posting was sent to
Eli Zaretskii 
<eliz@gnu.org>], who wrote in article 
<mailman.6646.1201548710.18990.help-gnu-emacs@gnu.org>:
> > > • is there a general solution to work with files (elisp) without
> > > actually loading the whole file?

> > Not really, since visiting a file reads all of it into an Emacs buffer.

> The problem is not with the buffer size per se, it's with the fact
> that Emacs needs to be able to address each byte of the file's text
> with an Emacs integer data type, which is 29 bit wide on 32-bit
> machines.

Are you sure?  I think it should be enough to address each char in the
buffer, plus 2 "guard zones" immediately before and after the buffer,
plus two "guard zones" at start and end of the file.

E.g., if the guard zone size is 1MB, then the "actual chunk of file"
goes from offset 2M to offset 126M in the buffer; accessing anything
from offset 1M to 2M "scrolls back" the chunk; accessing anything from
offset 0 to 1M loads the chunk at start of file, etc.

Why won't this work?

Yours,
Ilya


reply via email to

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