Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: third_party/sqlite/patches/0010-Allow-read-only-memory-mapping.patch

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 From 12b0ba774b11ae27c41ad20e62522c00567e2a0a Mon Sep 17 00:00:00 2001
2 From: Scott Hess <shess@chromium.org>
3 Date: Wed, 5 Aug 2015 16:44:32 -0700
4 Subject: [PATCH 10/10] Allow read-only memory mapping.
5
6 In memory-mapped I/O mode, SQLite writes pages by using memcpy() from
7 the staging memory into the underlying memory-mapped file. This allows
8 anyone in the process to also write into that space. Modify SQLite to
9 map things read-only.
10
11 TODO: Upstream.
12
13 BUG=489784
14 ---
15 third_party/sqlite/src/src/os_unix.c | 2 +-
16 third_party/sqlite/src/src/os_win.c | 2 +-
17 2 files changed, 2 insertions(+), 2 deletions(-)
18
19 diff --git a/third_party/sqlite/src/src/os_unix.c b/third_party/sqlite/src/src/o s_unix.c
20 index fa85638..523cad6 100644
21 --- a/third_party/sqlite/src/src/os_unix.c
22 +++ b/third_party/sqlite/src/src/os_unix.c
23 @@ -3141,7 +3141,7 @@ static int unixRead(
24 );
25 #endif
26
27 -#if SQLITE_MAX_MMAP_SIZE>0
28 +#if defined(SQLITE_MMAP_READWRITE) && SQLITE_MAX_MMAP_SIZE>0
29 /* Deal with as much of this read request as possible by transfering
30 ** data from the memory mapping using memcpy(). */
31 if( offset<pFile->mmapSize ){
32 diff --git a/third_party/sqlite/src/src/os_win.c b/third_party/sqlite/src/src/os _win.c
33 index 00ad6fd..8a68828 100644
34 --- a/third_party/sqlite/src/src/os_win.c
35 +++ b/third_party/sqlite/src/src/os_win.c
36 @@ -2524,7 +2524,7 @@ static int winRead(
37 "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile,
38 pFile->h, pBuf, amt, offset, pFile->locktype));
39
40 -#if SQLITE_MAX_MMAP_SIZE>0
41 +#if defined(SQLITE_MMAP_READWRITE) && SQLITE_MAX_MMAP_SIZE>0
42 /* Deal with as much of this read request as possible by transfering
43 ** data from the memory mapping using memcpy(). */
44 if( offset<pFile->mmapSize ){
45 --
46 2.7.0
47
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698