| OLD | NEW |
| 1 From d0e21d482f39c92f444957859bc9252dc6bb5239 Mon Sep 17 00:00:00 2001 | 1 From 1a93d36e638db170407cd0cbdaccd30c576ad4c4 Mon Sep 17 00:00:00 2001 |
| 2 From: rmcilroy <rmcilroy@chromium.org> | 2 From: rmcilroy <rmcilroy@chromium.org> |
| 3 Date: Thu, 20 Jun 2013 22:50:12 +0000 | 3 Date: Thu, 20 Jun 2013 22:50:12 +0000 |
| 4 Subject: [PATCH 02/10] Use seperate page-cache pools for each sqlite | 4 Subject: [PATCH 02/13] Use seperate page-cache pools for each sqlite |
| 5 connection. | 5 connection. |
| 6 | 6 |
| 7 Due to multiple different subsystems using sqlite, the shared global page | 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 | 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. | 9 enables a compile time flag to be set to disable shared cache pools. |
| 10 | 10 |
| 11 BUG=243769 | 11 BUG=243769 |
| 12 | 12 |
| 13 Original review URL: https://chromiumcodereview.appspot.com/17413004 | 13 Original review URL: https://chromiumcodereview.appspot.com/17413004 |
| 14 --- | 14 --- |
| 15 third_party/sqlite/src/src/pcache1.c | 6 +++++- | 15 third_party/sqlite/src/src/pcache1.c | 6 +++++- |
| 16 1 file changed, 5 insertions(+), 1 deletion(-) | 16 1 file changed, 5 insertions(+), 1 deletion(-) |
| 17 | 17 |
| 18 diff --git a/third_party/sqlite/src/src/pcache1.c b/third_party/sqlite/src/src/p
cache1.c | 18 diff --git a/third_party/sqlite/src/src/pcache1.c b/third_party/sqlite/src/src/p
cache1.c |
| 19 index 7147f6a..76030f9 100644 | 19 index 7147f6a..940bd62 100644 |
| 20 --- a/third_party/sqlite/src/src/pcache1.c | 20 --- a/third_party/sqlite/src/src/pcache1.c |
| 21 +++ b/third_party/sqlite/src/src/pcache1.c | 21 +++ b/third_party/sqlite/src/src/pcache1.c |
| 22 @@ -668,6 +668,8 @@ static int pcache1Init(void *NotUsed){ | 22 @@ -668,6 +668,8 @@ static int pcache1Init(void *NotUsed){ |
| 23 ** private PGroup (mode-1). pcache1.separateCache is false if the single | 23 ** private PGroup (mode-1). pcache1.separateCache is false if the single |
| 24 ** PGroup in pcache1.grp is used for all page caches (mode-2). | 24 ** PGroup in pcache1.grp is used for all page caches (mode-2). |
| 25 ** | 25 ** |
| 26 + ** * Always use separate caches (mode-1) if SQLITE_SEPARATE_CACHE_POOLS | 26 + ** * Always use separate caches (mode-1) if SQLITE_SEPARATE_CACHE_POOLS |
| 27 + ** | 27 + ** |
| 28 ** * Always use a unified cache (mode-2) if ENABLE_MEMORY_MANAGEMENT | 28 ** * Always use a unified cache (mode-2) if ENABLE_MEMORY_MANAGEMENT |
| 29 ** | 29 ** |
| 30 ** * Use a unified cache in single-threaded applications that have | 30 ** * Use a unified cache in single-threaded applications that have |
| 31 @@ -677,7 +679,9 @@ static int pcache1Init(void *NotUsed){ | 31 @@ -677,7 +679,9 @@ static int pcache1Init(void *NotUsed){ |
| 32 ** | 32 ** |
| 33 ** * Otherwise use separate caches (mode-1) | 33 ** * Otherwise use separate caches (mode-1) |
| 34 */ | 34 */ |
| 35 -#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) | 35 -#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) |
| 36 +#ifdef SQLITE_SEPARATE_CACHE_POOLS | 36 +#ifdef SQLITE_SEPARATE_CACHE_POOLS |
| 37 + const int separateCache = 1; | 37 + pcache1.separateCache = 1; |
| 38 +#elif defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) | 38 +#elif defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) |
| 39 pcache1.separateCache = 0; | 39 pcache1.separateCache = 0; |
| 40 #elif SQLITE_THREADSAFE | 40 #elif SQLITE_THREADSAFE |
| 41 pcache1.separateCache = sqlite3GlobalConfig.pPage==0 | 41 pcache1.separateCache = sqlite3GlobalConfig.pPage==0 |
| 42 -- | 42 -- |
| 43 2.7.0 | 43 2.7.0.rc3.207.g0ac5344 |
| 44 | 44 |
| OLD | NEW |