Re: [PATCH v7 12/13] pack-objects: shrink delta_size field in struct object_entry
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 31, 2018, 04:21 UTC
- Message-ID
- <CACsJy8Bt6eY5vu4SRvnrY3Wq3zC3j9yALXJy2Y1eL=LVrMickw@mail.gmail.com>
- In-Reply-To
- <20180330212419.GJ14782@sigill.intra.peff.net>
On Fri, Mar 30, 2018 at 11:24 PM, Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
> On Sat, Mar 24, 2018 at 07:33:52AM +0100, Nguyễn Thái Ngọc Duy wrote: >> @@ -2004,10 +2006,12 @@ static int try_delta(struct unpacked *trg, struct unpacked *src, >> delta_buf = create_delta(src->index, trg->data, trg_size, &delta_size, max_size); >> if (!delta_buf) >> return 0; >> + if (delta_size >= (1 << OE_DELTA_SIZE_BITS)) >> + return 0; > > This is the other spot that needs to be "1U". > > How come this doesn't get a pdata->oe_delta_size_limit like we have > pdata->oe_size_limit? Would we want a matching > $GIT_TEST_OE_DELTA_SIZE_BITS to test it, too?
Probably. This change does not look as risky as the others (no complicated fallback). But without $GIT_TEST_OE_DELTA_SIZE_BITS it's hard to know how the new code reacts when we get over the limit. I will add it.
-- Duy