mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Add a runtime interface to enable memory-management features. (CVS 2894)
FossilOrigin-Name: 44f8e3139aa3ad3fcce9028565dd9ad23bbe62a2
This commit is contained in:
16
src/btree.c
16
src/btree.c
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.287 2006/01/09 06:29:48 danielk1977 Exp $
|
||||
** $Id: btree.c,v 1.288 2006/01/09 09:59:49 danielk1977 Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@@ -6504,11 +6504,19 @@ int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
|
||||
** Enable the shared pager and schema features.
|
||||
*/
|
||||
int sqlite3_enable_shared_cache(int enable){
|
||||
ThreadData *pTsd = sqlite3ThreadData();
|
||||
if( pTsd->pPager ){
|
||||
ThreadData *pTd = sqlite3ThreadData();
|
||||
|
||||
/* It is only legal to call sqlite3_enable_shared_cache() when there
|
||||
** are no currently open b-trees that were opened by the calling thread.
|
||||
** This condition is only easy to detect if the shared-cache were
|
||||
** previously enabled (and is being disabled).
|
||||
*/
|
||||
if( pTd->pBtree && !enable ){
|
||||
assert( pTd->useSharedData );
|
||||
return SQLITE_MISUSE;
|
||||
}
|
||||
pTsd->useSharedData = enable;
|
||||
|
||||
pTd->useSharedData = enable;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user