1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Code size reductions in the pager. (CVS 2952)

FossilOrigin-Name: c7da3aa9bdf7b788424633015000955606e93f48
This commit is contained in:
drh
2006-01-15 20:28:28 +00:00
parent 78170b2e65
commit 3b59a5cc5f
3 changed files with 28 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
C Prepare\sfor\sthe\s3.3.1\salpha\srelease.\s(CVS\s2951) C Code\ssize\sreductions\sin\sthe\spager.\s(CVS\s2952)
D 2006-01-15T18:29:18 D 2006-01-15T20:28:28
F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967
F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -59,7 +59,7 @@ F src/os_unix.c 7daa1720d46bbc31c6138462b35876650eb1885e
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c cd4ca2753aeaad11f5c9b9b6ef28752f45ed4529 F src/os_win.c cd4ca2753aeaad11f5c9b9b6ef28752f45ed4529
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c a96b9c43664670576e41eac699277c7862d604d8 F src/pager.c 12da1f38d60a2c44925281d3a1bc2769fa36428b
F src/pager.h e0acb095b3ad0bca48f2ab00c87346665643f64f F src/pager.h e0acb095b3ad0bca48f2ab00c87346665643f64f
F src/parse.y 83df51fea35f68f7e07384d75dce83d1ed30434c F src/parse.y 83df51fea35f68f7e07384d75dce83d1ed30434c
F src/pragma.c 4496cc77dc35824e1c978c3d1413b8a5a4c777d3 F src/pragma.c 4496cc77dc35824e1c978c3d1413b8a5a4c777d3
@@ -341,7 +341,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 2170e803ad48cffa6dddf8b591e0c085a7e66c86 P 3e32bcf0b8ee8d7a3f26ced8d5887561eeb3e7ab
R d32ce5d10e628a78f04587f4467bc038 R 1dc12218426b9b407634d9b62a2d6462
U drh U drh
Z ebae064cfb288c0a8f53534192384c90 Z d78152e419c86dc956810ea23d275199

View File

@@ -1 +1 @@
3e32bcf0b8ee8d7a3f26ced8d5887561eeb3e7ab c7da3aa9bdf7b788424633015000955606e93f48

View File

@@ -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.236 2006/01/11 21:41:22 drh Exp $ ** @(#) $Id: pager.c,v 1.237 2006/01/15 20:28:28 drh Exp $
*/ */
#ifndef SQLITE_OMIT_DISKIO #ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -431,15 +431,11 @@ static const unsigned char aJournalMagic[] = {
** All values are stored on disk as big-endian. ** All values are stored on disk as big-endian.
*/ */
static int read32bits(OsFile *fd, u32 *pRes){ static int read32bits(OsFile *fd, u32 *pRes){
u32 res; unsigned char ac[4];
int rc; int rc = sqlite3OsRead(fd, ac, sizeof(ac));
rc = sqlite3OsRead(fd, &res, sizeof(res));
if( rc==SQLITE_OK ){ if( rc==SQLITE_OK ){
unsigned char ac[4]; *pRes = (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3];
memcpy(ac, &res, 4);
res = (ac[0]<<24) | (ac[1]<<16) | (ac[2]<<8) | ac[3];
} }
*pRes = res;
return rc; return rc;
} }
@@ -1691,34 +1687,35 @@ int sqlite3pager_open(
sqliteFree(zFullPathname); sqliteFree(zFullPathname);
strcpy(&pPager->zJournal[nameLen], "-journal"); strcpy(&pPager->zJournal[nameLen], "-journal");
pPager->fd = fd; pPager->fd = fd;
pPager->journalOpen = 0; /* pPager->journalOpen = 0; */
pPager->useJournal = useJournal && !memDb; pPager->useJournal = useJournal && !memDb;
pPager->noReadlock = noReadlock && readOnly; pPager->noReadlock = noReadlock && readOnly;
pPager->stmtOpen = 0; /* pPager->stmtOpen = 0; */
pPager->stmtInUse = 0; /* pPager->stmtInUse = 0; */
pPager->nRef = 0; /* pPager->nRef = 0; */
pPager->dbSize = memDb-1; pPager->dbSize = memDb-1;
pPager->pageSize = SQLITE_DEFAULT_PAGE_SIZE; pPager->pageSize = SQLITE_DEFAULT_PAGE_SIZE;
pPager->stmtSize = 0; /* pPager->stmtSize = 0; */
pPager->stmtJSize = 0; /* pPager->stmtJSize = 0; */
pPager->nPage = 0; /* pPager->nPage = 0; */
pPager->nMaxPage = 0; /* pPager->nMaxPage = 0; */
pPager->mxPage = 100; pPager->mxPage = 100;
pPager->state = PAGER_UNLOCK; assert( PAGER_UNLOCK==0 );
pPager->errMask = 0; /* pPager->state = PAGER_UNLOCK; */
/* pPager->errMask = 0; */
pPager->tempFile = tempFile; pPager->tempFile = tempFile;
pPager->memDb = memDb; pPager->memDb = memDb;
pPager->readOnly = readOnly; pPager->readOnly = readOnly;
pPager->needSync = 0; /* pPager->needSync = 0; */
pPager->noSync = pPager->tempFile || !useJournal; pPager->noSync = pPager->tempFile || !useJournal;
pPager->fullSync = (pPager->noSync?0:1); pPager->fullSync = (pPager->noSync?0:1);
pPager->pFirst = 0; /* pPager->pFirst = 0; */
pPager->pFirstSynced = 0; /* pPager->pFirstSynced = 0; */
pPager->pLast = 0; /* pPager->pLast = 0; */
pPager->nExtra = FORCE_ALIGNMENT(nExtra); pPager->nExtra = FORCE_ALIGNMENT(nExtra);
pPager->sectorSize = PAGER_SECTOR_SIZE; pPager->sectorSize = PAGER_SECTOR_SIZE;
pPager->pBusyHandler = 0; /* pPager->pBusyHandler = 0; */
memset(pPager->aHash, 0, sizeof(pPager->aHash)); /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
*ppPager = pPager; *ppPager = pPager;
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
if( pTsdro->useMemoryManagement ){ if( pTsdro->useMemoryManagement ){