From: drh Date: Tue, 27 Nov 2007 02:38:00 +0000 (+0000) Subject: Add likely() and unlikely() macros to the header file. They are not X-Git-Tag: version-3.5.3~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6dbc000786b583aa597f8430e642c3ed9d9431e;p=thirdparty%2Fsqlite.git Add likely() and unlikely() macros to the header file. They are not yet used for anything. (CVS 4562) FossilOrigin-Name: 485add38a1ef224732575f9998f06466dcc9742d --- diff --git a/manifest b/manifest index cec8ea7160..c2a035b6f3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Use\smacro\s__DARWIN__\srather\sthan\s__MACOS__\sfor\sconditional\ncompilation\sof\sMacOSX\sspecific\sfeatures.\s\sTicket\s#2780.\s(CVS\s4561) -D 2007-11-26T22:54:27 +C Add\slikely()\sand\sunlikely()\smacros\sto\sthe\sheader\sfile.\s\sThey\sare\snot\nyet\sused\sfor\sanything.\s(CVS\s4562) +D 2007-11-27T02:38:01 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 35396fd58890420b29edcf27b6c0e2d054862a6b F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -134,7 +134,7 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c c97be281cfc3dcb14902f45e4b16f20038eb83ff F src/sqlite.h.in 75ae0863db3a0b074868a6157e34b646dbe143dd F src/sqlite3ext.h a93f59cdee3638dc0c9c086f80df743a4e68c3cb -F src/sqliteInt.h 4498ab4210ee3481a0a785e5e9020a412f7d1156 +F src/sqliteInt.h 22fb7a7271dbabca410d71c6ad80897f063356b1 F src/sqliteLimit.h 15ffe2116746c27ace2b428a26a4fcd6dba6fa65 F src/table.c 1aeb9eab57b4235db86fe15a35dec76fb445a9c4 F src/tclsqlite.c 9923abeffc9b3d7dad58e92b319661521f60debf @@ -592,7 +592,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 5e02dbabcfa42173adff234c086df1e962824c92 -R 48a06aa36c83561109ee0fdfde0fed78 +P d0a4c2a36385c03dfadbb844823d0ed2458bf619 +R 68e874db096a0d636c7b15038d57783c U drh -Z 6e81ebc36d92b688936576124ed71082 +Z 0996ff707e65338ef5f990b0634c44ed diff --git a/manifest.uuid b/manifest.uuid index 11440337d4..cde8739602 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d0a4c2a36385c03dfadbb844823d0ed2458bf619 \ No newline at end of file +485add38a1ef224732575f9998f06466dcc9742d \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 5b10a9681e..c27b632c82 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,11 +11,26 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.619 2007/11/26 22:54:27 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.620 2007/11/27 02:38:01 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ +/* +** The macro unlikely() is a hint that surrounds a boolean +** expression that is usually false. Macro likely() surrounds +** a boolean expression that is usually true. GCC is able to +** use these hints to generate better code, sometimes. +*/ +#if defined(__GNUC__) +# define likely(X) __builtin_expect((X),1) +# define unlikely(X) __builtin_expect((X),0) +#else +# define likely(X) !!(X) +# define unlikely(X) !!(X) +#endif + + /* ** These #defines should enable >2GB file support on Posix if the ** underlying operating system supports it. If the OS lacks