From: admin@127.0.0.1   
      
   On Wed, 19 Nov 2025 11:22:08 +0100   
   albert@spenarnc.xs4all.nl wrote:   
      
   > In article <87o6oyrc7i.fsf@nightsong.com>,   
   > Paul Rubin wrote:   
   > >peter writes:   
   > >> As Anton has already noted lxf uses this internally for parsing source   
   files   
   > >> Mapping the file uses memory regions outside the current process.   
   > >> It is like first allocating memory and then reading in the entire file   
   > >   
   > >Yes mmap is a virtual memory thing though. My current thought is to use   
   > >READ-LINE with some fixed buffer size, but have two contiguous buffers   
   > >and call READ-LINE twice, to handle the case where a word is split   
   > >across two buffers. Then process all words (whitespace terminated)   
   > >until the last whitespace is found. Anything left gets copied back   
   > >to the beginning of the double buffer, before calling READ-LINE again.   
   > >It's not worth bothering with true double buffering.   
   >   
   > The ciforth approach is more sensible. The terminal input buffer is   
   > filled from the input stream. It is large say 16K.   
   > Now you carve lines out of the buffer, and use a parse pointer,   
   > maybe >IN. As soon as you find that there are no more line endings   
   > in the remaining buffer, you copy the remainder to the start of   
   > the buffer and fill the buffer to the brim.   
   > In this case you will not copy more than is necessary.   
   >   
   A good approach, IMHO.   
   But how do you deal with the case where there's no line ending at EoF?   
   ISTM an additional action is required for the last line.   
      
   --   
   Bah, and indeed Humbug.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|