OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'use_system_sqlite%': 0, | 7 'use_system_sqlite%': 0, |
8 'required_sqlite_version': '3.6.1', | 8 'required_sqlite_version': '3.6.1', |
9 }, | 9 }, |
10 'target_defaults': { | 10 'target_defaults': { |
(...skipping 10 matching lines...) Expand all Loading... |
21 # TODO(shess): This shouldn't use faux-SQLite naming. | 21 # TODO(shess): This shouldn't use faux-SQLite naming. |
22 'SQLITE_SEPARATE_CACHE_POOLS', | 22 'SQLITE_SEPARATE_CACHE_POOLS', |
23 # TODO(shess): SQLite adds mutexes to protect structures which cross | 23 # TODO(shess): SQLite adds mutexes to protect structures which cross |
24 # threads. In theory Chromium should be able to turn this off for a | 24 # threads. In theory Chromium should be able to turn this off for a |
25 # slight speed boost. | 25 # slight speed boost. |
26 'THREADSAFE', | 26 'THREADSAFE', |
27 # SQLite can spawn threads to sort in parallel if configured | 27 # SQLite can spawn threads to sort in parallel if configured |
28 # appropriately. Chromium doesn't configure SQLite for that, and would | 28 # appropriately. Chromium doesn't configure SQLite for that, and would |
29 # prefer to control distribution to worker threads. | 29 # prefer to control distribution to worker threads. |
30 'SQLITE_MAX_WORKER_THREADS=0', | 30 'SQLITE_MAX_WORKER_THREADS=0', |
31 # Allow 256MB mmap footprint per connection. Should not be too open-ended | |
32 # as that could cause memory fragmentation. 50MB encompasses the 99th | |
33 # percentile of Chrome databases in the wild. | |
34 # TODO(shess): A 64-bit-specific value could be 1G or more. | |
35 # TODO(shess): Figure out if exceeding this is costly. | |
36 'SQLITE_MAX_MMAP_SIZE=268435456', | |
37 # Use a read-only memory map when mmap'ed I/O is enabled to prevent memory | 31 # Use a read-only memory map when mmap'ed I/O is enabled to prevent memory |
38 # stompers from directly corrupting the database. | 32 # stompers from directly corrupting the database. |
39 # TODO(shess): Upstream the ability to use this define. | 33 # TODO(shess): Upstream the ability to use this define. |
40 'SQLITE_MMAP_READ_ONLY=1', | 34 'SQLITE_MMAP_READ_ONLY=1', |
41 # NOTE(shess): Some defines can affect the amalgamation. Those should be | 35 # NOTE(shess): Some defines can affect the amalgamation. Those should be |
42 # added to google_generate_amalgamation.sh, and the amalgamation | 36 # added to google_generate_amalgamation.sh, and the amalgamation |
43 # re-generated. Usually this involves disabling features which include | 37 # re-generated. Usually this involves disabling features which include |
44 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the | 38 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the |
45 # virtual table syntax entirely. Missing an item usually results in | 39 # virtual table syntax entirely. Missing an item usually results in |
46 # syntax working but execution failing. Review: | 40 # syntax working but execution failing. Review: |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 'defines': [ | 239 'defines': [ |
246 # Necessary to statically compile the extension. | 240 # Necessary to statically compile the extension. |
247 'SQLITE_CORE', | 241 'SQLITE_CORE', |
248 ], | 242 ], |
249 'sources': [ | 243 'sources': [ |
250 'src/ext/icu/icu.c', | 244 'src/ext/icu/icu.c', |
251 ], | 245 ], |
252 }, | 246 }, |
253 ], | 247 ], |
254 }], | 248 }], |
| 249 ['android_channel == "work"', { |
| 250 'target_defaults': { |
| 251 'defines': [ |
| 252 'SQLITE_MAX_MMAP_SIZE=0', |
| 253 ], |
| 254 }, |
| 255 }, { # else: android_channel != "work" |
| 256 'target_defaults': { |
| 257 'defines': [ |
| 258 # Allow 256MB mmap footprint per connection. Should not be too open-e
nded |
| 259 # as that could cause memory fragmentation. 50MB encompasses the 99th |
| 260 # percentile of Chrome databases in the wild. |
| 261 # TODO(shess): A 64-bit-specific value could be 1G or more. |
| 262 # TODO(shess): Figure out if exceeding this is costly. |
| 263 'SQLITE_MAX_MMAP_SIZE=268435456', |
| 264 ], |
| 265 }, |
| 266 }], |
255 ], | 267 ], |
256 } | 268 } |
OLD | NEW |