Re: [PATCH v2 11/18] maintenance: auto-size incremental-repack batch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/30/2020 12:57 PM, Derrick Stolee wrote:
> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux