-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sqlite: always use memory for tempfiles.
credits to @bavison for the MAP_POPULATE patch
- Loading branch information
1 parent
0f55e23
commit 59868b5
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/databases/sqlite/patches/sqlite-01_map_populate.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/sqlite3.c b/sqlite3.c | ||
index d0057a6..63b80c7 100644 | ||
--- a/sqlite3.c | ||
+++ b/sqlite3.c | ||
@@ -28278,7 +28278,7 @@ static void unixRemapfile( | ||
pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE); | ||
zErr = "mremap"; | ||
#else | ||
- pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED, h, nReuse); | ||
+ pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED | MAP_POPULATE, h, nReuse); | ||
if( pNew!=MAP_FAILED ){ | ||
if( pNew!=pReq ){ | ||
osMunmap(pNew, nNew - nReuse); | ||
@@ -28297,7 +28297,7 @@ static void unixRemapfile( | ||
|
||
/* If pNew is still NULL, try to create an entirely new mapping. */ | ||
if( pNew==0 ){ | ||
- pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0); | ||
+ pNew = osMmap(0, nNew, flags, MAP_SHARED | MAP_POPULATE, h, 0); | ||
} | ||
|
||
if( pNew==MAP_FAILED ){ |