Re: [PATCH v5 09/11] pack-objects: shrink size field in struct object_entry

2018-03-18 Thread Duy Nguyen
On Sun, Mar 18, 2018 at 6:09 AM, Junio C Hamano wrote: >> + uint32_t truncated_limit = (uint32_t)limit; >> + >> + return limit == truncated_limit; >> +} > > I am guessing that a compiler that is clever enough will make this > function a no-op on a 32-bit arch and that

Re: [PATCH v5 09/11] pack-objects: shrink size field in struct object_entry

2018-03-17 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +static inline int contains_in_32bits(unsigned long limit) > +{ This name somehow does not sound right. If the verb "contain" must be used, the way to phrase what this function does with the verb is to say "limit can be contained in a 32-bit

Re: [PATCH v5 09/11] pack-objects: shrink size field in struct object_entry

2018-03-17 Thread Ævar Arnfjörð Bjarmason
On Sat, Mar 17 2018, Nguyễn Thái Ngọc Duy jotted: > It's very very rare that an uncompressd object is larger than 4GB s/uncompressd/uncompressed/

[PATCH v5 09/11] pack-objects: shrink size field in struct object_entry

2018-03-17 Thread Nguyễn Thái Ngọc Duy
It's very very rare that an uncompressd object is larger than 4GB (partly because Git does not handle those large files very well to begin with). Let's optimize it for the common case where object size is smaller than this limit. Shrink size field down to 32 bits [1] and one overflow bit. If the