mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Use the MEMDB macro instead of OMIT_MEMORYDB in pager_recycle(). (CVS 3813)
FossilOrigin-Name: 97c5159816e211d9c71aa68db7c5e01df535d6a4
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Avoid\sattempting\sto\sreclaim\smemory\sfrom\sin-memory\sdatabases\sin\ssqlite3_release_memory().\s(CVS\s3812)
|
C Use\sthe\sMEMDB\smacro\sinstead\sof\sOMIT_MEMORYDB\sin\spager_recycle().\s(CVS\s3813)
|
||||||
D 2007-04-05T13:12:14
|
D 2007-04-05T14:29:43
|
||||||
F Makefile.in 29fbf08ce0989973bfed0b5a052a6bdf3e60fd0a
|
F Makefile.in 29fbf08ce0989973bfed0b5a052a6bdf3e60fd0a
|
||||||
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
||||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||||
@@ -86,7 +86,7 @@ F src/os_unix.c 13c6f73a7b0c2c6c131c97ea26274db101b594cd
|
|||||||
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
|
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
|
||||||
F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309
|
F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309
|
||||||
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
|
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
|
||||||
F src/pager.c 82dca058bfb68aa34a3ff330bc9ad466035375ae
|
F src/pager.c 6c70842fe6621968be7d87143032640b7bc7f3f8
|
||||||
F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42
|
F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42
|
||||||
F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3
|
F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3
|
||||||
F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234
|
F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234
|
||||||
@@ -450,7 +450,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
|
|||||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||||
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
||||||
P 973b2a5fb56a1ed1fd10d062edcb6e6dad13f001
|
P c20f7563c0ffa1df47df5464f1f1cc4703ffa9b4
|
||||||
R 3d61a3bac9e818ce7c0c533a6c40bb32
|
R 208747f649a24ee705a02097c6e213aa
|
||||||
U danielk1977
|
U danielk1977
|
||||||
Z 27fd82d7f84e6401bc77ed2f6bdb8478
|
Z 977a9e0a2f802e57fc1f9452318b947c
|
||||||
|
@@ -1 +1 @@
|
|||||||
c20f7563c0ffa1df47df5464f1f1cc4703ffa9b4
|
97c5159816e211d9c71aa68db7c5e01df535d6a4
|
22
src/pager.c
22
src/pager.c
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.321 2007/04/05 13:12:14 danielk1977 Exp $
|
** @(#) $Id: pager.c,v 1.322 2007/04/05 14:29:43 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -2615,7 +2615,6 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
|
|||||||
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
|
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
|
||||||
int sqlite3PagerReleaseMemory(int nReq){
|
int sqlite3PagerReleaseMemory(int nReq){
|
||||||
const ThreadData *pTsdro = sqlite3ThreadDataReadOnly();
|
const ThreadData *pTsdro = sqlite3ThreadDataReadOnly();
|
||||||
Pager *p;
|
|
||||||
int nReleased = 0;
|
int nReleased = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -2637,21 +2636,20 @@ int sqlite3PagerReleaseMemory(int nReq){
|
|||||||
for(i=0; i<=1; i++){
|
for(i=0; i<=1; i++){
|
||||||
|
|
||||||
/* Loop through all the SQLite pagers opened by the current thread. */
|
/* Loop through all the SQLite pagers opened by the current thread. */
|
||||||
for(p=pTsdro->pPager; p && (nReq<0 || nReleased<nReq); p=p->pNext){
|
Pager *pPager = pTsdro->pPager;
|
||||||
|
for( ; pPager && (nReq<0 || nReleased<nReq); pPager=pPager->pNext){
|
||||||
PgHdr *pPg;
|
PgHdr *pPg;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
#ifndef SQLITE_OMIT_MEMORYDB
|
if( MEMDB ){
|
||||||
if( p->memDb ){
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For each pager, try to free as many pages as possible (without
|
/* For each pager, try to free as many pages as possible (without
|
||||||
** calling fsync() if this is the first iteration of the outermost
|
** calling fsync() if this is the first iteration of the outermost
|
||||||
** loop).
|
** loop).
|
||||||
*/
|
*/
|
||||||
while( SQLITE_OK==(rc = pager_recycle(p, i, &pPg)) && pPg) {
|
while( SQLITE_OK==(rc = pager_recycle(pPager, i, &pPg)) && pPg) {
|
||||||
/* We've found a page to free. At this point the page has been
|
/* We've found a page to free. At this point the page has been
|
||||||
** removed from the page hash-table, free-list and synced-list
|
** removed from the page hash-table, free-list and synced-list
|
||||||
** (pFirstSynced). It is still in the all pages (pAll) list.
|
** (pFirstSynced). It is still in the all pages (pAll) list.
|
||||||
@@ -2663,10 +2661,10 @@ int sqlite3PagerReleaseMemory(int nReq){
|
|||||||
PgHdr *pTmp;
|
PgHdr *pTmp;
|
||||||
assert( pPg );
|
assert( pPg );
|
||||||
page_remove_from_stmt_list(pPg);
|
page_remove_from_stmt_list(pPg);
|
||||||
if( pPg==p->pAll ){
|
if( pPg==pPager->pAll ){
|
||||||
p->pAll = pPg->pNextAll;
|
pPager->pAll = pPg->pNextAll;
|
||||||
}else{
|
}else{
|
||||||
for( pTmp=p->pAll; pTmp->pNextAll!=pPg; pTmp=pTmp->pNextAll ){}
|
for( pTmp=pPager->pAll; pTmp->pNextAll!=pPg; pTmp=pTmp->pNextAll ){}
|
||||||
pTmp->pNextAll = pPg->pNextAll;
|
pTmp->pNextAll = pPg->pNextAll;
|
||||||
}
|
}
|
||||||
nReleased += sqliteAllocSize(pPg);
|
nReleased += sqliteAllocSize(pPg);
|
||||||
@@ -2681,8 +2679,8 @@ int sqlite3PagerReleaseMemory(int nReq){
|
|||||||
** of a shared pager cache) of the pager for which the error occured.
|
** of a shared pager cache) of the pager for which the error occured.
|
||||||
*/
|
*/
|
||||||
assert( (rc&0xff)==SQLITE_IOERR || rc==SQLITE_FULL );
|
assert( (rc&0xff)==SQLITE_IOERR || rc==SQLITE_FULL );
|
||||||
assert( p->state>=PAGER_RESERVED );
|
assert( pPager->state>=PAGER_RESERVED );
|
||||||
pager_error(p, rc);
|
pager_error(pPager, rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user