aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-01-19 21:20:11 +0000
committerdrh <drh@noemail.net>2017-01-19 21:20:11 +0000
commit8674e49214c8d9a0e23cf46c15d6bd4b74b00c4d (patch)
treee5cd2205908cc84db5d5ea1e439ddc17c1401b78 /src/sqliteInt.h
parent2f31d0204960ccfae468cef94a0447311b9bb143 (diff)
downloadsqlite-8674e49214c8d9a0e23cf46c15d6bd4b74b00c4d.tar.gz
sqlite-8674e49214c8d9a0e23cf46c15d6bd4b74b00c4d.zip
If compiled with SQLITE_INLINE_MEMCPY, all memcpy() calls are replaced with
in-line code. With that change, cachegrind shows which memcpy() calls are taking the most time. This is a performance-measurement hack only and is not for production use. FossilOrigin-Name: 9ed38521617136223a667988aed40e25797faf84
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index d5ac957d2..6344cac5f 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -512,6 +512,18 @@
#include <stddef.h>
/*
+** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY.
+** This allows better measurements of where memcpy() is used when running
+** cachegrind. But this macro version of memcpy() is very slow so it
+** should not be used in production. This is a performance measurement
+** hack only.
+*/
+#ifdef SQLITE_INLINE_MEMCPY
+# define memcpy(D,S,N) {char*xxd=(char*)(D);const char*xxs=(const char*)(S);\
+ int xxn=(N);while(xxn-->0)*(xxd++)=*(xxs++);}
+#endif
+
+/*
** If compiling for a processor that lacks floating point support,
** substitute integer for floating-point
*/