Re: [PATCH] fast-import: Stream very large blobs directly to pack
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 29, 2010, 05:29 UTC
- Message-ID
- <7vockdjx6w.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20100129012350.GD20488@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> +static void stream_blob( > + uintmax_t len, > + unsigned char *sha1out, > + uintmax_t mark)
A funny way to indent and line wrap...
Show 6 quoted lines
> +{
> + ...
> + /* Determine if we should auto-checkpoint. */
> + if ((pack_size + 60 + len) > max_packsize
> + || (pack_size + 60 + len) < pack_size)
> + cycle_packfile();What's "60" in this math?
If the data is not compressible, we could even grow and the end result might be more than (pack_size + len), busting max_packsize. As we are streaming out, we cannot say "oops, let me try again after truncating and closing the current file and then opening a new file", and instead may have to copy the data from the current one to a new one, and truncate the current one. Is this something worth worrying about?