This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [updated patch] malloc per-thread cache ready for review
- From: DJ Delorie <dj at redhat dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: siddhesh at gotplt dot org, libc-alpha at sourceware dot org, fweimer at redhat dot com
- Date: Wed, 05 Jul 2017 03:28:10 -0400
- Subject: Re: [updated patch] malloc per-thread cache ready for review
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dj at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C5F7D7D0E4
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C5F7D7D0E4
"Carlos O'Donell" <carlos@redhat.com> writes:
>> + if (tc_idx < mp_.tcache_bins
>> + && tc_idx < TCACHE_MAX_BINS /* to appease gcc */
>
> Right, 'tc_idx < mp_.tcache_bins && tc_idx < TCACHE_MAX_BINS' should
> always be true and reduce to 'tc_idx < mp_.tcache_bins', but I bet the
> compiler generates a warning when you remove the static check?
Actually, I can't get it to do it now... and I don't remember which
platform/build triggered it. Tested on F24 and Rawhide with that line
commented out, no warnings. I guess I'll just take that line out?
> In which case this is not the right fix. You need to remove the redundant
> check e.g. 'tc_idx < TCACHE_MAX_BINS' and then use DIAG_PUSH_NEEDS_COMMENT,
> DIAG_IGNORE_NEEDS_COMMENT, DIAG_POP_NEEDS_COMMENT, to document that you
Amusingly enough, I wrote the intial push/pop code in gcc that those
macros use!
> I suggest this trimmed down version:
Will do.