Lines Matching refs:sqlite3GlobalConfig

7838   #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)  macro
7844 #define sqlite3GlobalConfig sqlite3Config macro
13151 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( in sqlite3_db_status()
13643 if( sqlite3GlobalConfig.bLocaltimeFault ) pX = 0; in osLocaltime()
13650 if( sqlite3GlobalConfig.bLocaltimeFault ) return 1; in osLocaltime()
14863 testcase( sqlite3GlobalConfig.xLog!=0 ); in sqlite3MemMalloc()
14916 testcase( sqlite3GlobalConfig.xLog!=0 ); in sqlite3MemRealloc()
15160 if( !sqlite3GlobalConfig.bMemstat ){ in sqlite3MemInit()
15274 assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0 in sqlite3MemFree()
15351 if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){ in sqlite3MemdebugSetType()
15370 if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){ in sqlite3MemdebugHasType()
15392 if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){ in sqlite3MemdebugNoType()
15722 if( sqlite3GlobalConfig.bMemstat==0 && mem3.mutex==0 ){ in memsys3Enter()
16053 if( !sqlite3GlobalConfig.pHeap ){ in memsys3Init()
16059 mem3.aPool = (Mem3Block *)sqlite3GlobalConfig.pHeap; in memsys3Init()
16060 mem3.nPool = (sqlite3GlobalConfig.nHeap / sizeof(Mem3Block)) - 2; in memsys3Init()
16460 testcase( sqlite3GlobalConfig.xLog!=0 ); in memsys5MallocUnsafe()
16660 nByte = sqlite3GlobalConfig.nHeap; in memsys5Init()
16661 zByte = (u8*)sqlite3GlobalConfig.pHeap; in memsys5Init()
16665 nMinLog = memsys5Log(sqlite3GlobalConfig.mnReq); in memsys5Init()
16691 if( sqlite3GlobalConfig.bMemstat==0 ){ in memsys5Init()
16805 if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){ in sqlite3MutexInit()
16812 sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex; in sqlite3MutexInit()
16814 if( sqlite3GlobalConfig.bCoreMutex ){ in sqlite3MutexInit()
16824 rc = sqlite3GlobalConfig.mutex.xMutexInit(); in sqlite3MutexInit()
16839 if( sqlite3GlobalConfig.mutex.xMutexEnd ){ in sqlite3MutexEnd()
16840 rc = sqlite3GlobalConfig.mutex.xMutexEnd(); in sqlite3MutexEnd()
16857 return sqlite3GlobalConfig.mutex.xMutexAlloc(id); in sqlite3_mutex_alloc()
16861 if( !sqlite3GlobalConfig.bCoreMutex ){ in sqlite3MutexAlloc()
16865 return sqlite3GlobalConfig.mutex.xMutexAlloc(id); in sqlite3MutexAlloc()
16873 sqlite3GlobalConfig.mutex.xMutexFree(p); in sqlite3_mutex_free()
16883 sqlite3GlobalConfig.mutex.xMutexEnter(p); in sqlite3_mutex_enter()
16894 return sqlite3GlobalConfig.mutex.xMutexTry(p); in sqlite3_mutex_try()
16907 sqlite3GlobalConfig.mutex.xMutexLeave(p); in sqlite3_mutex_leave()
16917 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p); in sqlite3_mutex_held()
16920 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p); in sqlite3_mutex_notheld()
18254 if( sqlite3GlobalConfig.m.xMalloc==0 ){ in sqlite3MallocInit()
18258 if( sqlite3GlobalConfig.bCoreMutex ){ in sqlite3MallocInit()
18261 if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100 in sqlite3MallocInit()
18262 && sqlite3GlobalConfig.nScratch>0 ){ in sqlite3MallocInit()
18265 sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch); in sqlite3MallocInit()
18266 sqlite3GlobalConfig.szScratch = sz; in sqlite3MallocInit()
18267 pSlot = (ScratchFreeslot*)sqlite3GlobalConfig.pScratch; in sqlite3MallocInit()
18268 n = sqlite3GlobalConfig.nScratch; in sqlite3MallocInit()
18279 sqlite3GlobalConfig.pScratch = 0; in sqlite3MallocInit()
18280 sqlite3GlobalConfig.szScratch = 0; in sqlite3MallocInit()
18281 sqlite3GlobalConfig.nScratch = 0; in sqlite3MallocInit()
18283 if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512 in sqlite3MallocInit()
18284 || sqlite3GlobalConfig.nPage<1 ){ in sqlite3MallocInit()
18285 sqlite3GlobalConfig.pPage = 0; in sqlite3MallocInit()
18286 sqlite3GlobalConfig.szPage = 0; in sqlite3MallocInit()
18287 sqlite3GlobalConfig.nPage = 0; in sqlite3MallocInit()
18289 return sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData); in sqlite3MallocInit()
18305 if( sqlite3GlobalConfig.m.xShutdown ){ in sqlite3MallocEnd()
18306 sqlite3GlobalConfig.m.xShutdown(sqlite3GlobalConfig.m.pAppData); in sqlite3MallocEnd()
18362 nFull = sqlite3GlobalConfig.m.xRoundup(n); in mallocWithAlarm()
18373 p = sqlite3GlobalConfig.m.xMalloc(nFull); in mallocWithAlarm()
18377 p = sqlite3GlobalConfig.m.xMalloc(nFull); in mallocWithAlarm()
18404 }else if( sqlite3GlobalConfig.bMemstat ){ in sqlite3Malloc()
18409 p = sqlite3GlobalConfig.m.xMalloc(n); in sqlite3Malloc()
18451 if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){ in sqlite3ScratchMalloc()
18459 if( sqlite3GlobalConfig.bMemstat ){ in sqlite3ScratchMalloc()
18466 p = sqlite3GlobalConfig.m.xMalloc(n); in sqlite3ScratchMalloc()
18496 if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){ in sqlite3ScratchFree()
18504 assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch ); in sqlite3ScratchFree()
18512 if( sqlite3GlobalConfig.bMemstat ){ in sqlite3ScratchFree()
18518 sqlite3GlobalConfig.m.xFree(p); in sqlite3ScratchFree()
18521 sqlite3GlobalConfig.m.xFree(p); in sqlite3ScratchFree()
18545 return sqlite3GlobalConfig.m.xSize(p); in sqlite3MallocSize()
18555 return sqlite3GlobalConfig.m.xSize(p); in sqlite3DbMallocSize()
18566 if( sqlite3GlobalConfig.bMemstat ){ in sqlite3_free()
18570 sqlite3GlobalConfig.m.xFree(p); in sqlite3_free()
18573 sqlite3GlobalConfig.m.xFree(p); in sqlite3_free()
18624 nNew = sqlite3GlobalConfig.m.xRoundup(nBytes); in sqlite3Realloc()
18627 }else if( sqlite3GlobalConfig.bMemstat ){ in sqlite3Realloc()
18637 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); in sqlite3Realloc()
18640 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); in sqlite3Realloc()
18648 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); in sqlite3Realloc()
19858 sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode, in renderLogMsg()
19867 if( sqlite3GlobalConfig.xLog ){ in sqlite3_log()
21675 testcase( sqlite3GlobalConfig.xLog!=0 ); in sqlite3SafetyCheckOk()
21689 testcase( sqlite3GlobalConfig.xLog!=0 ); in sqlite3SafetyCheckSickOrOk()
35309 sqlite3GlobalConfig.pcache.xUnpin(pCache->pCache, p, 0);
35319 if( sqlite3GlobalConfig.pcache.xInit==0 ){
35325 return sqlite3GlobalConfig.pcache.xInit(sqlite3GlobalConfig.pcache.pArg);
35328 if( sqlite3GlobalConfig.pcache.xShutdown ){
35330 sqlite3GlobalConfig.pcache.xShutdown(sqlite3GlobalConfig.pcache.pArg);
35369 sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache);
35399 p = sqlite3GlobalConfig.pcache.xCreate(nByte, pCache->bPurgeable);
35403 sqlite3GlobalConfig.pcache.xCachesize(p, pCache->nMax);
35409 pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, eCreate);
35435 sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache),
35444 pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, 2);
35517 sqlite3GlobalConfig.pcache.xUnpin(pCache->pCache, p, 1);
35575 sqlite3GlobalConfig.pcache.xRekey(pCache->pCache, p, p->pgno, newPgno);
35612 sqlite3GlobalConfig.pcache.xTruncate(pCache->pCache, pgno+1);
35621 sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache);
35733 nPage = sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache);
35753 sqlite3GlobalConfig.pcache.xCachesize(pCache->pCache, mxPage);
36540 if( sqlite3GlobalConfig.bCoreMutex ){
36585 int separateCache = sqlite3GlobalConfig.bCoreMutex>0;
48330 sqlite3GlobalConfig.sharedCacheEnabled = enable;
50147 if( SQLITE_THREADSAFE && sqlite3GlobalConfig.bCoreMutex ){
64380 testcase( sqlite3GlobalConfig.xLog!=0 );
64383 testcase( sqlite3GlobalConfig.xLog!=0 );
69752 testcase( sqlite3GlobalConfig.xLog!=0 );
110268 if( sqlite3GlobalConfig.isInit ) return SQLITE_OK;
110289 sqlite3GlobalConfig.isMutexInit = 1;
110290 if( !sqlite3GlobalConfig.isMallocInit ){
110294 sqlite3GlobalConfig.isMallocInit = 1;
110295 if( !sqlite3GlobalConfig.pInitMutex ){
110296 sqlite3GlobalConfig.pInitMutex =
110298 if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){
110304 sqlite3GlobalConfig.nRefInitMutex++;
110328 sqlite3_mutex_enter(sqlite3GlobalConfig.pInitMutex);
110329 if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
110331 sqlite3GlobalConfig.inProgress = 1;
110334 if( sqlite3GlobalConfig.isPCacheInit==0 ){
110338 sqlite3GlobalConfig.isPCacheInit = 1;
110342 sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
110343 sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
110344 sqlite3GlobalConfig.isInit = 1;
110346 sqlite3GlobalConfig.inProgress = 0;
110348 sqlite3_mutex_leave(sqlite3GlobalConfig.pInitMutex);
110354 sqlite3GlobalConfig.nRefInitMutex--;
110355 if( sqlite3GlobalConfig.nRefInitMutex<=0 ){
110356 assert( sqlite3GlobalConfig.nRefInitMutex==0 );
110357 sqlite3_mutex_free(sqlite3GlobalConfig.pInitMutex);
110358 sqlite3GlobalConfig.pInitMutex = 0;
110385 if( rc==SQLITE_OK && sqlite3GlobalConfig.isInit ){
110403 if( sqlite3GlobalConfig.isInit ){
110406 sqlite3GlobalConfig.isInit = 0;
110408 if( sqlite3GlobalConfig.isPCacheInit ){
110410 sqlite3GlobalConfig.isPCacheInit = 0;
110412 if( sqlite3GlobalConfig.isMallocInit ){
110414 sqlite3GlobalConfig.isMallocInit = 0;
110416 if( sqlite3GlobalConfig.isMutexInit ){
110418 sqlite3GlobalConfig.isMutexInit = 0;
110439 if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;
110450 sqlite3GlobalConfig.bCoreMutex = 0;
110451 sqlite3GlobalConfig.bFullMutex = 0;
110457 sqlite3GlobalConfig.bCoreMutex = 1;
110458 sqlite3GlobalConfig.bFullMutex = 0;
110463 sqlite3GlobalConfig.bCoreMutex = 1;
110464 sqlite3GlobalConfig.bFullMutex = 1;
110469 sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
110474 *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
110482 sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*);
110487 if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault();
110488 *va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m;
110493 sqlite3GlobalConfig.bMemstat = va_arg(ap, int);
110498 sqlite3GlobalConfig.pScratch = va_arg(ap, void*);
110499 sqlite3GlobalConfig.szScratch = va_arg(ap, int);
110500 sqlite3GlobalConfig.nScratch = va_arg(ap, int);
110505 sqlite3GlobalConfig.pPage = va_arg(ap, void*);
110506 sqlite3GlobalConfig.szPage = va_arg(ap, int);
110507 sqlite3GlobalConfig.nPage = va_arg(ap, int);
110513 sqlite3GlobalConfig.pcache = *va_arg(ap, sqlite3_pcache_methods*);
110518 if( sqlite3GlobalConfig.pcache.xInit==0 ){
110521 *va_arg(ap, sqlite3_pcache_methods*) = sqlite3GlobalConfig.pcache;
110528 sqlite3GlobalConfig.pHeap = va_arg(ap, void*);
110529 sqlite3GlobalConfig.nHeap = va_arg(ap, int);
110530 sqlite3GlobalConfig.mnReq = va_arg(ap, int);
110532 if( sqlite3GlobalConfig.mnReq<1 ){
110533 sqlite3GlobalConfig.mnReq = 1;
110534 }else if( sqlite3GlobalConfig.mnReq>(1<<12) ){
110536 sqlite3GlobalConfig.mnReq = (1<<12);
110539 if( sqlite3GlobalConfig.pHeap==0 ){
110545 memset(&sqlite3GlobalConfig.m, 0, sizeof(sqlite3GlobalConfig.m));
110552 sqlite3GlobalConfig.m = *sqlite3MemGetMemsys3();
110555 sqlite3GlobalConfig.m = *sqlite3MemGetMemsys5();
110563 sqlite3GlobalConfig.szLookaside = va_arg(ap, int);
110564 sqlite3GlobalConfig.nLookaside = va_arg(ap, int);
110578 sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t);
110579 sqlite3GlobalConfig.pLogArg = va_arg(ap, void*);
110584 sqlite3GlobalConfig.bOpenUri = va_arg(ap, int);
111988 if( ((flags & SQLITE_OPEN_URI) || sqlite3GlobalConfig.bOpenUri)
112218 if( sqlite3GlobalConfig.bCoreMutex==0 ){
112225 isThreadsafe = sqlite3GlobalConfig.bFullMutex;
112229 }else if( sqlite3GlobalConfig.sharedCacheEnabled ){
112417 setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
112418 sqlite3GlobalConfig.nLookaside);
112425 assert( db->mutex!=0 || isThreadsafe==0 || sqlite3GlobalConfig.bFullMutex==0 );
112631 testcase( sqlite3GlobalConfig.xLog!=0 );
112638 testcase( sqlite3GlobalConfig.xLog!=0 );
112645 testcase( sqlite3GlobalConfig.xLog!=0 );
113067 sqlite3GlobalConfig.bLocaltimeFault = va_arg(ap, int);