OLD | NEW |
1 From 3a6d9302ff14aec82291c7e2212ce37b7453ce9f Mon Sep 17 00:00:00 2001 | 1 From d0e21d482f39c92f444957859bc9252dc6bb5239 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 03/16] Use seperate page-cache pools for each sqlite | 4 Subject: [PATCH 02/10] 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 a8c3217..3fcee4b 100644 | 19 index 7147f6a..76030f9 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 @@ -567,6 +567,8 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra
, int bPurgeable){ | 22 @@ -668,6 +668,8 @@ static int pcache1Init(void *NotUsed){ |
23 ** PGroup. In other words, separateCache is true for mode (1) where no | 23 ** private PGroup (mode-1). pcache1.separateCache is false if the single |
24 ** mutexing is required. | 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 ** * Always use a unified cache in single-threaded applications | 30 ** * Use a unified cache in single-threaded applications that have |
31 @@ -574,7 +576,9 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra
, int bPurgeable){ | 31 @@ -677,7 +679,9 @@ static int pcache1Init(void *NotUsed){ |
32 ** * Otherwise (if multi-threaded and ENABLE_MEMORY_MANAGEMENT is off) | 32 ** |
33 ** use separate caches (mode-1) | 33 ** * Otherwise use separate caches (mode-1) |
34 */ | 34 */ |
35 -#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0 | 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 + const int separateCache = 1; |
38 +#elif defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || SQLITE_THREADSAFE==0 | 38 +#elif defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) |
39 const int separateCache = 0; | 39 pcache1.separateCache = 0; |
40 #else | 40 #elif SQLITE_THREADSAFE |
41 int separateCache = sqlite3GlobalConfig.bCoreMutex>0; | 41 pcache1.separateCache = sqlite3GlobalConfig.pPage==0 |
42 -- | 42 -- |
43 2.2.1 | 43 2.7.0 |
44 | 44 |
OLD | NEW |