Web lists-archives.com

Re: [PATCH 046/194] object-store: move replace_objects back to object-store




On Fri, Feb 9, 2018 at 3:15 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Stefan Beller <sbeller@xxxxxxxxxx> writes:
>
>> @@ -32,7 +31,15 @@ struct object_store {
>>        * Objects that should be substituted by other objects
>>        * (see git-replace(1)).
>>        */
>> -     struct replace_objects replacements;
>> +     struct replace_objects {
>> +             /*
>> +              * An array of replacements.  The array is kept sorted by the original
>> +              * sha1.
>> +              */
>> +             struct replace_object **items;
>> +
>> +             int alloc, nr;
>> +     } replacements;
>>
>>       /*
>>        * A fast, rough count of the number of objects in the repository.
>> @@ -49,7 +56,7 @@ struct object_store {
>>       unsigned packed_git_initialized : 1;
>>  };
>>  #define OBJECT_STORE_INIT \
>> -     { NULL, MRU_INIT, ALTERNATES_INIT, REPLACE_OBJECTS_INIT, 0, 0, 0 }
>> +     { NULL, MRU_INIT, ALTERNATES_INIT, { NULL, 0, 0 }, 0, 0, 0 }

Maybe we can move the REPLACE_OBJECTS_INIT just before the
definition of OBJECT_STORE_INIT, so we'd not need to touch this line here.

>
> Not the primary thrust of this topic, but we may want to convert
> these to use designated initializers after this series is done.

I agree.

I feel cbc0f81d96 (strbuf: use designated initializers in STRBUF_INIT,
2017-07-10)
may need longer cooking until all the interesting architectures have
tried picking up
the latest release, though.

Stefan