1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

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
This commit is contained in:
drh
2017-01-19 21:20:11 +00:00
parent 2f31d02049
commit 8674e49214
6 changed files with 23 additions and 16 deletions

View File

@@ -511,6 +511,18 @@
#include <assert.h>
#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