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

Refactor sqlite3OsFileControlNoFail() into sqlite3FileControlHint().

FossilOrigin-Name: 722735a4f316630c907149f08d3d7dccc0facd9a
This commit is contained in:
drh
2012-01-10 17:59:59 +00:00
parent 04333f9b3e
commit c02372ce6f
7 changed files with 34 additions and 31 deletions

View File

@@ -2766,12 +2766,11 @@ end_playback:
** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the
** assertion that the transaction counter was modified.
*/
sqlite3BeginBenignMalloc();
assert(
pPager->fd->pMethods==0 ||
sqlite3OsFileControlNoFail(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0)>=0
);
sqlite3EndBenignMalloc();
#ifdef SQLITE_DEBUG
if( pPager->fd->pMethods ){
sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
}
#endif
/* If this playback is happening automatically as a result of an IO or
** malloc error that occurred after the change-counter was updated but
@@ -4050,7 +4049,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
assert( rc!=SQLITE_OK || isOpen(pPager->fd) );
if( rc==SQLITE_OK && pPager->dbSize>pPager->dbHintSize ){
sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
sqlite3OsFileControlNoFail(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
pPager->dbHintSize = pPager->dbSize;
}