From: danielk1977 Date: Thu, 5 Apr 2007 14:29:42 +0000 (+0000) Subject: Use the MEMDB macro instead of OMIT_MEMORYDB in pager_recycle(). (CVS 3813) X-Git-Tag: version-3.6.10~2357 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38ec0cb263e705b808584e577a1bf50df57c4af8;p=thirdparty%2Fsqlite.git Use the MEMDB macro instead of OMIT_MEMORYDB in pager_recycle(). (CVS 3813) FossilOrigin-Name: 97c5159816e211d9c71aa68db7c5e01df535d6a4 --- diff --git a/manifest b/manifest index 674e91fbd1..cad149143e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\sattempting\sto\sreclaim\smemory\sfrom\sin-memory\sdatabases\sin\ssqlite3_release_memory().\s(CVS\s3812) -D 2007-04-05T13:12:14 +C Use\sthe\sMEMDB\smacro\sinstead\sof\sOMIT_MEMORYDB\sin\spager_recycle().\s(CVS\s3813) +D 2007-04-05T14:29:43 F Makefile.in 29fbf08ce0989973bfed0b5a052a6bdf3e60fd0a F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -86,7 +86,7 @@ F src/os_unix.c 13c6f73a7b0c2c6c131c97ea26274db101b594cd F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b -F src/pager.c 82dca058bfb68aa34a3ff330bc9ad466035375ae +F src/pager.c 6c70842fe6621968be7d87143032640b7bc7f3f8 F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42 F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3 F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234 @@ -450,7 +450,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 973b2a5fb56a1ed1fd10d062edcb6e6dad13f001 -R 3d61a3bac9e818ce7c0c533a6c40bb32 +P c20f7563c0ffa1df47df5464f1f1cc4703ffa9b4 +R 208747f649a24ee705a02097c6e213aa U danielk1977 -Z 27fd82d7f84e6401bc77ed2f6bdb8478 +Z 977a9e0a2f802e57fc1f9452318b947c diff --git a/manifest.uuid b/manifest.uuid index 28c1e5b283..a999ac3c0c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c20f7563c0ffa1df47df5464f1f1cc4703ffa9b4 \ No newline at end of file +97c5159816e211d9c71aa68db7c5e01df535d6a4 \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index ba80e8fa47..92e6edf4e1 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** 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 #include "sqliteInt.h" @@ -2615,7 +2615,6 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){ #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT int sqlite3PagerReleaseMemory(int nReq){ const ThreadData *pTsdro = sqlite3ThreadDataReadOnly(); - Pager *p; int nReleased = 0; int i; @@ -2637,21 +2636,20 @@ int sqlite3PagerReleaseMemory(int nReq){ for(i=0; i<=1; i++){ /* Loop through all the SQLite pagers opened by the current thread. */ - for(p=pTsdro->pPager; p && (nReq<0 || nReleasedpNext){ + Pager *pPager = pTsdro->pPager; + for( ; pPager && (nReq<0 || nReleasedpNext){ PgHdr *pPg; int rc; -#ifndef SQLITE_OMIT_MEMORYDB - if( p->memDb ){ + if( MEMDB ){ continue; } -#endif /* For each pager, try to free as many pages as possible (without ** calling fsync() if this is the first iteration of the outermost ** 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 ** removed from the page hash-table, free-list and synced-list ** (pFirstSynced). It is still in the all pages (pAll) list. @@ -2663,10 +2661,10 @@ int sqlite3PagerReleaseMemory(int nReq){ PgHdr *pTmp; assert( pPg ); page_remove_from_stmt_list(pPg); - if( pPg==p->pAll ){ - p->pAll = pPg->pNextAll; + if( pPg==pPager->pAll ){ + pPager->pAll = pPg->pNextAll; }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; } nReleased += sqliteAllocSize(pPg); @@ -2681,8 +2679,8 @@ int sqlite3PagerReleaseMemory(int nReq){ ** of a shared pager cache) of the pager for which the error occured. */ assert( (rc&0xff)==SQLITE_IOERR || rc==SQLITE_FULL ); - assert( p->state>=PAGER_RESERVED ); - pager_error(p, rc); + assert( pPager->state>=PAGER_RESERVED ); + pager_error(pPager, rc); } } }