]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add likely() and unlikely() macros to the header file. They are not
authordrh <drh@noemail.net>
Tue, 27 Nov 2007 02:38:00 +0000 (02:38 +0000)
committerdrh <drh@noemail.net>
Tue, 27 Nov 2007 02:38:00 +0000 (02:38 +0000)
yet used for anything. (CVS 4562)

FossilOrigin-Name: 485add38a1ef224732575f9998f06466dcc9742d

manifest
manifest.uuid
src/sqliteInt.h

index cec8ea7160e105a705a028a7184a60cc451be4d7..c2a035b6f3d2f01ebb2a1181201bef770abf0b68 100644 (file)
--- 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
index 11440337d40dd863c01e948a124f713892056aba..cde87396023f1778420c4a5b1dba7d715b352690 100644 (file)
@@ -1 +1 @@
-d0a4c2a36385c03dfadbb844823d0ed2458bf619
\ No newline at end of file
+485add38a1ef224732575f9998f06466dcc9742d
\ No newline at end of file
index 5b10a9681ee0c56d2bf5f6538ea5a486b47a4e20..c27b632c8234558b7e8773b0b4d5f9fa148aa85a 100644 (file)
 *************************************************************************
 ** 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