| OLD | NEW |
| 1 diff --git src/pcache1.c src/pcache1.c | 1 From 22030cd2e05e746a169066c37b28c580b0a57284 Mon Sep 17 00:00:00 2001 |
| 2 From: rmcilroy <rmcilroy@chromium.org> |
| 3 Date: Thu, 20 Jun 2013 22:50:12 +0000 |
| 4 Subject: [PATCH 04/23] Use seperate page-cache pools for each sqlite |
| 5 connection. |
| 6 |
| 7 Due to multiple different subsystems using sqlite, the shared global page |
| 8 cache policy does not suite our use-cases on Chrome very well. This CL |
| 9 enables a compile time flag to be set to disable shared cache pools. |
| 10 |
| 11 BUG=243769 |
| 12 |
| 13 Original review URL: https://chromiumcodereview.appspot.com/17413004 |
| 14 --- |
| 15 third_party/sqlite/src/src/pcache1.c | 8 ++++++-- |
| 16 1 file changed, 6 insertions(+), 2 deletions(-) |
| 17 |
| 18 diff --git a/third_party/sqlite/src/src/pcache1.c b/third_party/sqlite/src/src/p
cache1.c |
| 2 index ad44395..e4d0705 100644 | 19 index ad44395..e4d0705 100644 |
| 3 --- src/pcache1.c | 20 --- a/third_party/sqlite/src/src/pcache1.c |
| 4 +++ src/pcache1.c | 21 +++ b/third_party/sqlite/src/src/pcache1.c |
| 5 @@ -549,10 +549,12 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurg
eable){ | 22 @@ -549,10 +549,12 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurg
eable){ |
| 6 int sz; /* Bytes of memory required to allocate the new cache *
/ | 23 int sz; /* Bytes of memory required to allocate the new cache *
/ |
| 7 | 24 |
| 8 /* | 25 /* |
| 9 - ** The seperateCache variable is true if each PCache has its own private | 26 - ** The seperateCache variable is true if each PCache has its own private |
| 10 + ** The separateCache variable is true if each PCache has its own private | 27 + ** The separateCache variable is true if each PCache has its own private |
| 11 ** PGroup. In other words, separateCache is true for mode (1) where no | 28 ** PGroup. In other words, separateCache is true for mode (1) where no |
| 12 ** mutexing is required. | 29 ** mutexing is required. |
| 13 ** | 30 ** |
| 14 + ** * Always use separate caches (mode-1) if SQLITE_SEPARATE_CACHE_POOLS | 31 + ** * Always use separate caches (mode-1) if SQLITE_SEPARATE_CACHE_POOLS |
| 15 + ** | 32 + ** |
| 16 ** * Always use a unified cache (mode-2) if ENABLE_MEMORY_MANAGEMENT | 33 ** * Always use a unified cache (mode-2) if ENABLE_MEMORY_MANAGEMENT |
| 17 ** | 34 ** |
| 18 ** * Always use a unified cache in single-threaded applications | 35 ** * Always use a unified cache in single-threaded applications |
| 19 @@ -560,7 +562,9 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurgea
ble){ | 36 @@ -560,7 +562,9 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurgea
ble){ |
| 20 ** * Otherwise (if multi-threaded and ENABLE_MEMORY_MANAGEMENT is off) | 37 ** * Otherwise (if multi-threaded and ENABLE_MEMORY_MANAGEMENT is off) |
| 21 ** use separate caches (mode-1) | 38 ** use separate caches (mode-1) |
| 22 */ | 39 */ |
| 23 -#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0 | 40 -#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0 |
| 24 +#ifdef SQLITE_SEPARATE_CACHE_POOLS | 41 +#ifdef SQLITE_SEPARATE_CACHE_POOLS |
| 25 + const int separateCache = 1; | 42 + const int separateCache = 1; |
| 26 +#elif defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0 | 43 +#elif defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0 |
| 27 const int separateCache = 0; | 44 const int separateCache = 0; |
| 28 #else | 45 #else |
| 29 int separateCache = sqlite3GlobalConfig.bCoreMutex>0; | 46 int separateCache = sqlite3GlobalConfig.bCoreMutex>0; |
| 47 -- |
| 48 2.2.1 |
| 49 |
| OLD | NEW |