Re: [PATCH v2 11/18] maintenance: auto-size incremental-repack batch
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jul 30, 2020, 19:02 UTC
- Message-ID
- <c0b9876a-9041-3400-25ac-e52568a02074@gmail.com>
- In-Reply-To
- <b374cb3a-f681-d514-c465-6b3f0b674bcf@gmail.com>
On 7/30/2020 12:57 PM, Derrick Stolee wrote:
Show 18 quoted lines
> On 7/29/2020 6:23 PM, Emily Shaffer wrote: >> On Thu, Jul 23, 2020 at 05:56:33PM +0000, Derrick Stolee via GitGitGadget wrote: >>> diff --git a/builtin/gc.c b/builtin/gc.c >>> index eb4b01c104..889d97afe7 100644 >>> --- a/builtin/gc.c >>> +++ b/builtin/gc.c >>> @@ -1021,19 +1021,65 @@ static int multi_pack_index_expire(void) >>> return result; >>> } >>> >>> +#define TWO_GIGABYTES (2147483647) >> >> [jonathan tan] This would be easier to understand if it was expressed >> with bitshift, e.g. 1 << 31 > > This is actually ((1 << 31) - 1) because "unsigned long" is 32-bits > on Windows. But it's better to not use magic numbers and instead use > operations like this.
Nevermind. This breaks the build on 32-bit machines (even adding a few "L" characters). I'll replace my magic decimal number with a magic hexadecimal number.
Thanks, -Stolee