From 3114ef0b0cb5d50ebed0e96d238f8ee00a8cc270 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 15 Dec 2020 01:08:14 +0300 Subject: [PATCH] Always build SQLCipher with OMIT_MEMLOCK to significantly increase its performance. --- sqlite/CMakeLists.txt | 2 +- sqlite/sqlite/sqlite3.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlite/CMakeLists.txt b/sqlite/CMakeLists.txt index b439b0cd6..319fe0d11 100644 --- a/sqlite/CMakeLists.txt +++ b/sqlite/CMakeLists.txt @@ -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) diff --git a/sqlite/sqlite/sqlite3.c b/sqlite/sqlite/sqlite3.c index 9f5890681..cb15a29a3 100644 --- a/sqlite/sqlite/sqlite3.c +++ b/sqlite/sqlite/sqlite3.c @@ -22555,7 +22555,7 @@ end_of_export: /* #include "sqlcipher.h" */ /* #include "crypto.h" */ -#ifndef OMIT_MEMLOCK +// #ifndef OMIT_MEMLOCK #if defined(__unix__) || defined(__APPLE__) || defined(_AIX) #include #include @@ -22564,7 +22564,7 @@ end_of_export: #elif defined(_WIN32) #include #endif -#endif +// #endif static volatile unsigned int default_flags = DEFAULT_CIPHER_FLAGS; static volatile unsigned char hmac_salt_mask = HMAC_SALT_MASK;