aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <>2022-04-01 18:45:11 +0000
committerdrh <>2022-04-01 18:45:11 +0000
commitcf6e3fd787fdcc3eb2e5edf2ea80146a195ac874 (patch)
treef888cdbb2d806c26ecaec3dc8620ed655ecd06e9 /src/sqliteInt.h
parent473571b083e6387da0a0268ab396bf1243a15491 (diff)
downloadsqlite-cf6e3fd787fdcc3eb2e5edf2ea80146a195ac874.tar.gz
sqlite-cf6e3fd787fdcc3eb2e5edf2ea80146a195ac874.zip
New macro ROUND8P() which works like ROUND8() but assumes that the input is
already a multiple of the size of a pointer. It becomes a no-op for 64-bit machines, giving a small size reduction and speed boost. FossilOrigin-Name: d126f304cde66ebfe21a4967c22dcba0bac27cbce56318b14bd50051e49c978c
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 0f4077aae..6b08281fe 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -939,8 +939,19 @@ typedef INT16_TYPE LogEst;
/*
** Round up a number to the next larger multiple of 8. This is used
** to force 8-byte alignment on 64-bit architectures.
+**
+** ROUND8() always does the rounding, for any argument.
+**
+** ROUND8P() assumes that the argument is already an integer number of
+** pointers in size, and so it is a no-op on systems where the pointer
+** size is 8.
*/
#define ROUND8(x) (((x)+7)&~7)
+#if SQLITE_PTRSIZE==8
+# define ROUND8P(x) (x)
+#else
+# define ROUND8P(x) (((x)+7)&~7)
+#endif
/*
** Round down to the nearest multiple of 8