]> git.ipfire.org Git - thirdparty/git.git/commit - pack-check.c
Loop over pack_windows when inflating/accessing data.
authorShawn O. Pearce <spearce@spearce.org>
Sat, 23 Dec 2006 07:34:13 +0000 (02:34 -0500)
committerJunio C Hamano <junkio@cox.net>
Fri, 29 Dec 2006 19:36:44 +0000 (11:36 -0800)
commit079afb18fed078af01bd9ab02e2ebbe5d31893b1
tree79fcc6e294e90e3a49f8bad533ee40dcdf2e627d
parent03e79c88aa34ce188eb4fb7509e6d127c79c507d
Loop over pack_windows when inflating/accessing data.

When multiple mmaps start getting used for all pack file access it
is not possible to get all data associated with a specific object
in one contiguous memory region.  This limitation prevents simply
passing a single address and length to SHA1_Update or to inflate.

Instead we need to loop until we have processed all data of interest.

As we loop over the data we are always interested in reusing the same
window 'cursor', as the prior window will no longer be of any use
to us.  This allows the use_pack() call to automatically decrement
the use count of the prior window before setting up access for us
to the next window.

Within each loop we need to make use of the available length output
parameter of use_pack() to tell us how many bytes are available in
the current memory region, as we cannot tell otherwise.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-pack-objects.c
pack-check.c
sha1_file.c