diff options
author | chappedm@gmail.com <chappedm@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2012-12-22 20:06:47 +0000 |
---|---|---|
committer | chappedm@gmail.com <chappedm@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2012-12-22 20:06:47 +0000 |
commit | 84b983c8d43f43a3c7f71d45d51fc4adcc688cd9 (patch) | |
tree | 7976021f2984cb489d544634af4f45961299c8c2 /configure | |
parent | a5dacccd6ae4cbfedb5263bfe0f325f03c7f0db8 (diff) | |
download | gperftools-84b983c8d43f43a3c7f71d45d51fc4adcc688cd9.tar.gz |
issue-465: Adding automagic support for __builtin_expect
Previously __builtin_ expect was based on a macro check against gcc version.
Now we perform the check via AM which is a cleaner approach. There are also
a number of code changes here to utilize LIKELY/UNLIKELY macros based on
__builtin_expect to improve performance.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@189 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -16233,6 +16233,33 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +# Check for __builtin_expect() +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect()" >&5 +$as_echo_n "checking for __builtin_expect()... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return __builtin_expect(main != 0, 1) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +$as_echo "#define HAVE_BUILTIN_EXPECT 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + # Check if __environ is available (for GetenvBeforeMain) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __environ" >&5 $as_echo_n "checking for __environ... " >&6; } |