mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +00:00
sqlite: always use memory for tempfiles.
credits to @bavison for the MAP_POPULATE patch
This commit is contained in:
parent
0f55e23544
commit
59868b5cf1
@ -61,7 +61,7 @@ PKG_AUTORECONF="yes"
|
|||||||
# SQLITE_MAX_MMAP_SIZE can be modified at start-time using the
|
# SQLITE_MAX_MMAP_SIZE can be modified at start-time using the
|
||||||
# sqlite3_config(SQLITE_CONFIG_MMAP_SIZE) call, or at run-time using the
|
# sqlite3_config(SQLITE_CONFIG_MMAP_SIZE) call, or at run-time using the
|
||||||
# mmap_size pragma.
|
# mmap_size pragma.
|
||||||
CFLAGS="$CFLAGS -DSQLITE_DEFAULT_MMAP_SIZE=268435456"
|
CFLAGS="$CFLAGS -DSQLITE_TEMP_STORE=3 -DSQLITE_DEFAULT_MMAP_SIZE=268435456"
|
||||||
|
|
||||||
|
|
||||||
PKG_CONFIGURE_OPTS_TARGET="--enable-static \
|
PKG_CONFIGURE_OPTS_TARGET="--enable-static \
|
||||||
|
@ -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 ){
|
Loading…
x
Reference in New Issue
Block a user