OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 declare_args() { | 5 declare_args() { |
6 # Controls whether the build should uses the version of sqlite3 library | 6 # Controls whether the build should uses the version of sqlite3 library |
7 # shipped with the system (currently only supported on iOS) or the one | 7 # shipped with the system (currently only supported on iOS) or the one |
8 # shipped with Chromium source. | 8 # shipped with Chromium source. |
9 use_system_sqlite = is_ios | 9 use_system_sqlite = is_ios |
10 } | 10 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 # TODO(shess): SQLite adds mutexes to protect structures which cross | 61 # TODO(shess): SQLite adds mutexes to protect structures which cross |
62 # threads. In theory Chromium should be able to turn this off for a | 62 # threads. In theory Chromium should be able to turn this off for a |
63 # slight speed boost. | 63 # slight speed boost. |
64 "THREADSAFE", | 64 "THREADSAFE", |
65 | 65 |
66 # SQLite can spawn threads to sort in parallel if configured | 66 # SQLite can spawn threads to sort in parallel if configured |
67 # appropriately. Chromium doesn't configure SQLite for that, and would | 67 # appropriately. Chromium doesn't configure SQLite for that, and would |
68 # prefer to control distribution to worker threads. | 68 # prefer to control distribution to worker threads. |
69 "SQLITE_MAX_WORKER_THREADS=0", | 69 "SQLITE_MAX_WORKER_THREADS=0", |
70 | 70 |
| 71 # Allow 256MB mmap footprint per connection. Should not be too open-ended |
| 72 # as that could cause memory fragmentation. 50MB encompasses the 99th |
| 73 # percentile of Chrome databases in the wild. |
| 74 # TODO(shess): A 64-bit-specific value could be 1G or more. |
| 75 # TODO(shess): Figure out if exceeding this is costly. |
| 76 "SQLITE_MAX_MMAP_SIZE=268435456", |
| 77 |
71 # Use a read-only memory map when mmap'ed I/O is enabled to prevent memory | 78 # Use a read-only memory map when mmap'ed I/O is enabled to prevent memory |
72 # stompers from directly corrupting the database. | 79 # stompers from directly corrupting the database. |
73 # TODO(shess): Upstream the ability to use this define. | 80 # TODO(shess): Upstream the ability to use this define. |
74 "SQLITE_MMAP_READ_ONLY=1", | 81 "SQLITE_MMAP_READ_ONLY=1", |
75 | 82 |
76 # NOTE(shess): Some defines can affect the amalgamation. Those should be | 83 # NOTE(shess): Some defines can affect the amalgamation. Those should be |
77 # added to google_generate_amalgamation.sh, and the amalgamation | 84 # added to google_generate_amalgamation.sh, and the amalgamation |
78 # re-generated. Usually this involves disabling features which include | 85 # re-generated. Usually this involves disabling features which include |
79 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the | 86 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the |
80 # virtual table syntax entirely. Missing an item usually results in | 87 # virtual table syntax entirely. Missing an item usually results in |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } else if (is_android) { | 150 } else if (is_android) { |
144 defines += [ | 151 defines += [ |
145 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", | 152 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
146 "SQLITE_DEFAULT_AUTOVACUUM=1", | 153 "SQLITE_DEFAULT_AUTOVACUUM=1", |
147 "SQLITE_TEMP_STORE=3", | 154 "SQLITE_TEMP_STORE=3", |
148 "SQLITE_ENABLE_FTS3_BACKWARDS", | 155 "SQLITE_ENABLE_FTS3_BACKWARDS", |
149 "DSQLITE_DEFAULT_FILE_FORMAT=4", | 156 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
150 ] | 157 ] |
151 } | 158 } |
152 | 159 |
153 if (defined(android_channel) && android_channel == "work") { | |
154 defines += [ | |
155 "SQLITE_MAX_MMAP_SIZE=0", | |
156 ] | |
157 } else { | |
158 defines += [ | |
159 # Allow 256MB mmap footprint per connection. Should not be too open-end
ed | |
160 # as that could cause memory fragmentation. 50MB encompasses the 99th | |
161 # percentile of Chrome databases in the wild. | |
162 # TODO(shess): A 64-bit-specific value could be 1G or more. | |
163 # TODO(shess): Figure out if exceeding this is costly. | |
164 "SQLITE_MAX_MMAP_SIZE=268435456", | |
165 ] | |
166 } | |
167 deps = [ | 160 deps = [ |
168 "//third_party/icu", | 161 "//third_party/icu", |
169 ] | 162 ] |
170 } | 163 } |
171 | 164 |
172 config("sqlite_export") { | 165 config("sqlite_export") { |
173 if (is_component_build && is_win) { | 166 if (is_component_build && is_win) { |
174 defines = [ "SQLITE_API=__declspec(dllimport)" ] | 167 defines = [ "SQLITE_API=__declspec(dllimport)" ] |
175 } | 168 } |
176 } | 169 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 "//third_party/icu", | 237 "//third_party/icu", |
245 ] | 238 ] |
246 if (is_clang) { | 239 if (is_clang) { |
247 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 240 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
248 # conversion from string literal to bool. | 241 # conversion from string literal to bool. |
249 configs -= [ "//build/config/clang:extra_warnings" ] | 242 configs -= [ "//build/config/clang:extra_warnings" ] |
250 } | 243 } |
251 } | 244 } |
252 } | 245 } |
253 } | 246 } |
OLD | NEW |