This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: remove __builtin_expect
- From: Steven Munroe <munroesj at linux dot vnet dot ibm dot com>
- To: Yury Gribov <y dot gribov at samsung dot com>
- Cc: Joern Engel <joern at purestorage dot com>, "GNU C. Library" <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Joern Engel <joern at purestorage dot org>
- Date: Tue, 26 Jan 2016 14:43:13 -0600
- Subject: Re: [PATCH] malloc: remove __builtin_expect
- Authentication-results: sourceware.org; auth=none
- References: <1453767942-19369-1-git-send-email-joern at purestorage dot com> <1453767942-19369-21-git-send-email-joern at purestorage dot com> <56A726C1 dot 6070206 at samsung dot com>
- Reply-to: munroesj at linux dot vnet dot ibm dot com
On Tue, 2016-01-26 at 10:56 +0300, Yury Gribov wrote:
> On 01/26/2016 03:24 AM, Joern Engel wrote:
> > From: Joern Engel <joern@purestorage.org>
> >
> > It was disabled anyway and only served as obfuscation. No change
> > post-compilation.
>
> FYI I've witnessed significant improvements from (real) __builtin_expect
> in other projects.
>
It depends on the platform and if the programmer correctly understands
the behavior of the program as written.
Net, except for error cases that "should not happen, ever", a bad idea.