Skip to content

Commit

Permalink
Always build SQLCipher with OMIT_MEMLOCK to significantly increase it…
Browse files Browse the repository at this point in the history
…s performance.
  • Loading branch information
levlam committed Dec 14, 2020
1 parent 941bc7a commit 3114ef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sqlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ target_compile_definitions(tdsqlite PRIVATE
#-DSQLITE_OMIT_DEPRECATED # SQLCipher uses deprecated sqlite3_profile
#-DSQLITE_OMIT_SHARED_CACHE
)
target_compile_definitions(tdsqlite PRIVATE -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_FTS5 -DSQLITE_DISABLE_LFS)
target_compile_definitions(tdsqlite PRIVATE -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_FTS5 -DSQLITE_DISABLE_LFS -DOMIT_MEMLOCK)

if (NOT WIN32)
target_compile_definitions(tdsqlite PRIVATE -DHAVE_USLEEP -DNDEBUG=1)
Expand Down
4 changes: 2 additions & 2 deletions sqlite/sqlite/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -22555,7 +22555,7 @@ void sqlcipher_exportFunc(sqlite3_context *context, int argc, sqlite3_value **ar

/* #include "sqlcipher.h" */
/* #include "crypto.h" */
#ifndef OMIT_MEMLOCK
// #ifndef OMIT_MEMLOCK
#if defined(__unix__) || defined(__APPLE__) || defined(_AIX)
#include <errno.h>
#include <unistd.h>
Expand All @@ -22564,7 +22564,7 @@ void sqlcipher_exportFunc(sqlite3_context *context, int argc, sqlite3_value **ar
#elif defined(_WIN32)
#include <windows.h>
#endif
#endif
// #endif

static volatile unsigned int default_flags = DEFAULT_CIPHER_FLAGS;
static volatile unsigned char hmac_salt_mask = HMAC_SALT_MASK;
Expand Down

0 comments on commit 3114ef0

Please sign in to comment.