All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Peart <peartben@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Ben Peart <benpeart@microsoft.com>
Subject: Re: [PATCH v1] load_cache_entries_threaded: remove unused src_offset parameter
Date: Tue, 23 Oct 2018 15:13:06 -0400	[thread overview]
Message-ID: <7a359876-7d36-5d01-5f47-76ef316b6386@gmail.com> (raw)
In-Reply-To: <xmqqo9bltwdy.fsf@gitster-ct.c.googlers.com>



On 10/22/2018 7:05 PM, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
> 
>> If nobody uses it, should we drop the return value, too? Like:
> 
> Yup.
> 

I'm good with that.

At one point I also had the additional #ifndef NO_PTHREADS lines but it 
was starting to get messy with the threaded vs non-threaded code paths 
so I removed them.  I'm fine with which ever people find more readable.

It does make me wonder if there are still platforms taking new build of 
git that don't support threads.  Do we still need to 
write/test/debug/read through the single threaded code paths?

Is the diff Peff sent enough or do you want me to send another iteration 
on the patch?

Thanks,

Ben

>>
>> diff --git a/read-cache.c b/read-cache.c
>> index 78c9516eb7..4b44a2eae5 100644
>> --- a/read-cache.c
>> +++ b/read-cache.c
>> @@ -2052,12 +2052,11 @@ static void *load_cache_entries_thread(void *_data)
>>   	return NULL;
>>   }
>>   
>> -static unsigned long load_cache_entries_threaded(struct index_state *istate, const char *mmap, size_t mmap_size,
>> -						 int nr_threads, struct index_entry_offset_table *ieot)
>> +static void load_cache_entries_threaded(struct index_state *istate, const char *mmap, size_t mmap_size,
>> +					int nr_threads, struct index_entry_offset_table *ieot)
>>   {
>>   	int i, offset, ieot_blocks, ieot_start, err;
>>   	struct load_cache_entries_thread_data *data;
>> -	unsigned long consumed = 0;
>>   
>>   	/* a little sanity checking */
>>   	if (istate->name_hash_initialized)
>> @@ -2115,12 +2114,9 @@ static unsigned long load_cache_entries_threaded(struct index_state *istate, con
>>   		if (err)
>>   			die(_("unable to join load_cache_entries thread: %s"), strerror(err));
>>   		mem_pool_combine(istate->ce_mem_pool, p->ce_mem_pool);
>> -		consumed += p->consumed;
>>   	}
>>   
>>   	free(data);
>> -
>> -	return consumed;
>>   }
>>   #endif
>>   
>>
>> -Peff

  reply	other threads:[~2018-10-23 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 15:05 [PATCH v1] load_cache_entries_threaded: remove unused src_offset parameter Ben Peart
2018-10-22 20:17 ` Jeff King
2018-10-22 23:05   ` Junio C Hamano
2018-10-23 19:13     ` Ben Peart [this message]
2018-10-23 20:07       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a359876-7d36-5d01-5f47-76ef316b6386@gmail.com \
    --to=peartben@gmail.com \
    --cc=benpeart@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.