On Sun, Apr 23, 2006 at 08:34:39PM +0200, Juliusz Chroboczek wrote:
>
> >>> hunk <file> <byte#> <line#> <#old bytes> <#old lines> <#new bytes> <#new
> >>> lines>
> >>> old:
> >>> <the old data>
> >>> new:
> >>> <the new data>
> >>> end.
>
> >> Question: do we want to allow for arbitrary amounts of padding in
> >> order to page-align the data? This might provide a slight performance
> >> benefit when mmapping.
>
> > That's already allowed by the lexing function dropping arbitrary
> > whitespace before "old" and "new".
>
> Hmm... my understanding is that with the new patch format, you just
> mmap/read/gzread the patch file, check for the strings ``old:'',
> ``new:'' and ``end.'' at the right file offsets (which are implied by
> the <#old bytes> and <#new bytes>), then extract the actual data. There
> is no lexing whatsoever -- you never even touch the mmapped pages
> until you need the data.
I'm assuming the patch parsing code is going to look (very roughly) like
this:
"hunk" <- my_lex
fn <- my_lex
...
old_bytes <- my_lex_int
...
"old:" <- my_lex
skip '\n'
old_data <- takeBytes old_bytes
skip '\n'
"new:" <- my_lex
...
so the '"old:" <- my_lex' can skip over any white space that is put in
for alignment purposes. Have I misunderstood what you mean?
Thanks
Ian
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel