This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [updated patch] malloc per-thread cache ready for review


"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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]