本文整理汇总了C#中Community.CsharpSqlite.Pager.xCodecFree方法的典型用法代码示例。如果您正苦于以下问题:C# Pager.xCodecFree方法的具体用法?C# Pager.xCodecFree怎么用?C# Pager.xCodecFree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Community.CsharpSqlite.Pager
的用法示例。
在下文中一共展示了Pager.xCodecFree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sqlite3PagerClose
/*
** Shutdown the page cache. Free all memory and close all files.
**
** If a transaction was in progress when this routine is called, that
** transaction is rolled back. All outstanding pages are invalidated
** and their memory is freed. Any attempt to use a page associated
** with this page cache after this function returns will likely
** result in a coredump.
**
** This function always succeeds. If a transaction is active an attempt
** is made to roll it back. If an error occurs during the rollback
** a hot journal may be left in the filesystem but no error is returned
** to the caller.
*/
static int sqlite3PagerClose( Pager pPager )
{
#if SQLITE_TEST
disable_simulated_io_errors();
#endif
sqlite3BeginBenignMalloc();
pPager.errCode = 0;
pPager.exclusiveMode = false;
pager_reset( pPager );
if (
#if SQLITE_OMIT_MEMORYDB
1==MEMDB
#else
1 == pPager.memDb
#endif
)
{
pager_unlock( pPager );
}
else
{
/* Set Pager.journalHdr to -1 for the benefit of the pager_playback()
** call which may be made from within pagerUnlockAndRollback(). If it
** is not -1, then the unsynced portion of an open journal file may
** be played back into the database. If a power failure occurs while
** this is happening, the database may become corrupt.
*/
pPager.journalHdr = -1;
pagerUnlockAndRollback( pPager );
}
sqlite3EndBenignMalloc();
#if SQLITE_TEST
enable_simulated_io_errors();
#endif
PAGERTRACE( "CLOSE %d\n", PAGERID( pPager ) );
IOTRACE( "CLOSE %p\n", pPager );
sqlite3OsClose( pPager.fd );
//sqlite3_free( ref pPager.pTmpSpace );
sqlite3PcacheClose( pPager.pPCache );
#if SQLITE_HAS_CODEC
if ( pPager.xCodecFree != null ) pPager.xCodecFree(ref pPager.pCodec );
#endif
Debug.Assert( null == pPager.aSavepoint && !pPager.pInJournal );
Debug.Assert( !isOpen( pPager.jfd ) && !isOpen( pPager.sjfd ) );
//sqlite3_free( ref pPager );
return SQLITE_OK;
}
示例2: sqlite3PagerSetCodec
/*
** Set or retrieve the codec for this pager
*/
static void sqlite3PagerSetCodec(
Pager pPager,
dxCodec xCodec, //void *(*xCodec)(void*,void*,Pgno,int),
dxCodecSizeChng xCodecSizeChng, //void (*xCodecSizeChng)(void*,int,int),
dxCodecFree xCodecFree, //void (*xCodecFree)(void*),
codec_ctx pCodec
)
{
if ( pPager.xCodecFree != null ) pPager.xCodecFree( ref pPager.pCodec );
pPager.xCodec = (pPager.memDb!=0) ? null : xCodec;
pPager.xCodecSizeChng = xCodecSizeChng;
pPager.xCodecFree = xCodecFree;
pPager.pCodec = pCodec;
pagerReportSize( pPager );
}
示例3: sqlite3PagerClose
/*
** Shutdown the page cache. Free all memory and close all files.
**
** If a transaction was in progress when this routine is called, that
** transaction is rolled back. All outstanding pages are invalidated
** and their memory is freed. Any attempt to use a page associated
** with this page cache after this function returns will likely
** result in a coredump.
**
** This function always succeeds. If a transaction is active an attempt
** is made to roll it back. If an error occurs during the rollback
** a hot journal may be left in the filesystem but no error is returned
** to the caller.
*/
static int sqlite3PagerClose( Pager pPager )
{
u8[] pTmp = pPager.pTmpSpace;
#if SQLITE_TEST
disable_simulated_io_errors();
#endif
sqlite3BeginBenignMalloc();
/* pPager->errCode = 0; */
pPager.exclusiveMode = false;
#if !SQLITE_OMIT_WAL
sqlite3WalClose(pPager->pWal, pPager->ckptSyncFlags, pPager->pageSize, pTmp);
pPager.pWal = 0;
#endif
pager_reset( pPager );
if (
#if SQLITE_OMIT_MEMORYDB
1==MEMDB
#else
1 == pPager.memDb
#endif
)
{
pager_unlock( pPager );
}
else
{
/* If it is open, sync the journal file before calling UnlockAndRollback.
** If this is not done, then an unsynced portion of the open journal
** file may be played back into the database. If a power failure occurs
** while this is happening, the database could become corrupt.
**
** If an error occurs while trying to sync the journal, shift the pager
** into the ERROR state. This causes UnlockAndRollback to unlock the
** database and close the journal file without attempting to roll it
** back or finalize it. The next database user will have to do hot-journal
** rollback before accessing the database file.
*/
if ( isOpen( pPager.jfd ) )
{
pager_error( pPager, pagerSyncHotJournal( pPager ) );
}
pagerUnlockAndRollback( pPager );
}
sqlite3EndBenignMalloc();
#if SQLITE_TEST
enable_simulated_io_errors();
#endif
PAGERTRACE( "CLOSE %d\n", PAGERID( pPager ) );
IOTRACE( "CLOSE %p\n", pPager );
sqlite3OsClose( pPager.jfd );
sqlite3OsClose( pPager.fd );
//sqlite3_free( ref pTmp );
sqlite3PcacheClose( pPager.pPCache );
#if SQLITE_HAS_CODEC
if ( pPager.xCodecFree != null )
pPager.xCodecFree( ref pPager.pCodec );
#endif
Debug.Assert( null == pPager.aSavepoint && !pPager.pInJournal );
Debug.Assert( !isOpen( pPager.jfd ) && !isOpen( pPager.sjfd ) );
//sqlite3_free( ref pPager );
return SQLITE_OK;
}