Lines Matching refs:sqlite3GlobalConfig
7327 #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
7333 #define sqlite3GlobalConfig sqlite3Config
12549 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * (
14162 ** sqlite3GlobalConfig.m with pointers to the routines in this file.
14226 testcase( sqlite3GlobalConfig.xLog!=0 );
14279 testcase( sqlite3GlobalConfig.xLog!=0 );
14314 ** sqlite3GlobalConfig.m with pointers to the routines in this file.
14522 if( !sqlite3GlobalConfig.bMemstat ){
14636 assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0
14693 ** sqlite3GlobalConfig.m with pointers to the routines in this file.
14713 if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){
14732 if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){
14754 if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){
15081 ** sqlite3GlobalConfig.bMemStat is true.
15084 if( sqlite3GlobalConfig.bMemstat==0 && mem3.mutex==0 ){
15415 if( !sqlite3GlobalConfig.pHeap ){
15421 mem3.aPool = (Mem3Block *)sqlite3GlobalConfig.pHeap;
15422 mem3.nPool = (sqlite3GlobalConfig.nHeap / sizeof(Mem3Block)) - 2;
15528 ** sqlite3GlobalConfig.m with pointers to the routines in this file. The
15738 ** sqlite3GlobalConfig.bMemStat is true.
15822 testcase( sqlite3GlobalConfig.xLog!=0 );
16022 nByte = sqlite3GlobalConfig.nHeap;
16023 zByte = (u8*)sqlite3GlobalConfig.pHeap;
16026 nMinLog = memsys5Log(sqlite3GlobalConfig.mnReq);
16052 if( sqlite3GlobalConfig.bMemstat==0 ){
16166 if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){
16170 ** the default implementation into the sqlite3GlobalConfig structure.
16173 sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex;
16175 if( sqlite3GlobalConfig.bCoreMutex ){
16185 rc = sqlite3GlobalConfig.mutex.xMutexInit();
16200 if( sqlite3GlobalConfig.mutex.xMutexEnd ){
16201 rc = sqlite3GlobalConfig.mutex.xMutexEnd();
16218 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
16222 if( !sqlite3GlobalConfig.bCoreMutex ){
16226 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
16234 sqlite3GlobalConfig.mutex.xMutexFree(p);
16244 sqlite3GlobalConfig.mutex.xMutexEnter(p);
16255 return sqlite3GlobalConfig.mutex.xMutexTry(p);
16268 sqlite3GlobalConfig.mutex.xMutexLeave(p);
16278 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
16281 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
17514 ** Pointers to the end of sqlite3GlobalConfig.pScratch memory
17611 if( sqlite3GlobalConfig.m.xMalloc==0 ){
17615 if( sqlite3GlobalConfig.bCoreMutex ){
17618 if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
17619 && sqlite3GlobalConfig.nScratch>0 ){
17622 sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch);
17623 sqlite3GlobalConfig.szScratch = sz;
17624 pSlot = (ScratchFreeslot*)sqlite3GlobalConfig.pScratch;
17625 n = sqlite3GlobalConfig.nScratch;
17636 sqlite3GlobalConfig.pScratch = 0;
17637 sqlite3GlobalConfig.szScratch = 0;
17638 sqlite3GlobalConfig.nScratch = 0;
17640 if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512
17641 || sqlite3GlobalConfig.nPage<1 ){
17642 sqlite3GlobalConfig.pPage = 0;
17643 sqlite3GlobalConfig.szPage = 0;
17644 sqlite3GlobalConfig.nPage = 0;
17646 return sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
17662 if( sqlite3GlobalConfig.m.xShutdown ){
17663 sqlite3GlobalConfig.m.xShutdown(sqlite3GlobalConfig.m.pAppData);
17719 nFull = sqlite3GlobalConfig.m.xRoundup(n);
17730 p = sqlite3GlobalConfig.m.xMalloc(nFull);
17734 p = sqlite3GlobalConfig.m.xMalloc(nFull);
17761 }else if( sqlite3GlobalConfig.bMemstat ){
17766 p = sqlite3GlobalConfig.m.xMalloc(n);
17808 if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){
17816 if( sqlite3GlobalConfig.bMemstat ){
17823 p = sqlite3GlobalConfig.m.xMalloc(n);
17853 if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){
17861 assert( mem0.nScratchFree<=sqlite3GlobalConfig.nScratch );
17869 if( sqlite3GlobalConfig.bMemstat ){
17875 sqlite3GlobalConfig.m.xFree(p);
17878 sqlite3GlobalConfig.m.xFree(p);
17902 return sqlite3GlobalConfig.m.xSize(p);
17912 return sqlite3GlobalConfig.m.xSize(p);
17923 if( sqlite3GlobalConfig.bMemstat ){
17927 sqlite3GlobalConfig.m.xFree(p);
17930 sqlite3GlobalConfig.m.xFree(p);
17981 nNew = sqlite3GlobalConfig.m.xRoundup(nBytes);
17984 }else if( sqlite3GlobalConfig.bMemstat ){
17993 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
17996 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
18004 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
19197 sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode,
19206 if( sqlite3GlobalConfig.xLog ){
20994 testcase( sqlite3GlobalConfig.xLog!=0 );
21008 testcase( sqlite3GlobalConfig.xLog!=0 );
32956 sqlite3GlobalConfig.pcache.xUnpin(pCache->pCache, p, 0);
32966 if( sqlite3GlobalConfig.pcache.xInit==0 ){
32972 return sqlite3GlobalConfig.pcache.xInit(sqlite3GlobalConfig.pcache.pArg);
32975 if( sqlite3GlobalConfig.pcache.xShutdown ){
32977 sqlite3GlobalConfig.pcache.xShutdown(sqlite3GlobalConfig.pcache.pArg);
33016 sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache);
33046 p = sqlite3GlobalConfig.pcache.xCreate(nByte, pCache->bPurgeable);
33050 sqlite3GlobalConfig.pcache.xCachesize(p, pCache->nMax);
33056 pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, eCreate);
33084 pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, 2);
33157 sqlite3GlobalConfig.pcache.xUnpin(pCache->pCache, p, 1);
33215 sqlite3GlobalConfig.pcache.xRekey(pCache->pCache, p, p->pgno, newPgno);
33252 sqlite3GlobalConfig.pcache.xTruncate(pCache->pCache, pgno+1);
33261 sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache);
33373 nPage = sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache);
33393 sqlite3GlobalConfig.pcache.xCachesize(pCache->pCache, mxPage);
33878 if( sqlite3GlobalConfig.bCoreMutex ){
45428 sqlite3GlobalConfig.sharedCacheEnabled = enable;
47239 if( SQLITE_THREADSAFE && sqlite3GlobalConfig.bCoreMutex ){
61260 testcase( sqlite3GlobalConfig.xLog!=0 );
61263 testcase( sqlite3GlobalConfig.xLog!=0 );
66440 testcase( sqlite3GlobalConfig.xLog!=0 );
104931 if( sqlite3GlobalConfig.isInit ) return SQLITE_OK;
104952 sqlite3GlobalConfig.isMutexInit = 1;
104953 if( !sqlite3GlobalConfig.isMallocInit ){
104957 sqlite3GlobalConfig.isMallocInit = 1;
104958 if( !sqlite3GlobalConfig.pInitMutex ){
104959 sqlite3GlobalConfig.pInitMutex =
104961 if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){
104967 sqlite3GlobalConfig.nRefInitMutex++;
104991 sqlite3_mutex_enter(sqlite3GlobalConfig.pInitMutex);
104992 if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
104994 sqlite3GlobalConfig.inProgress = 1;
104997 if( sqlite3GlobalConfig.isPCacheInit==0 ){
105001 sqlite3GlobalConfig.isPCacheInit = 1;
105005 sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
105006 sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
105007 sqlite3GlobalConfig.isInit = 1;
105009 sqlite3GlobalConfig.inProgress = 0;
105011 sqlite3_mutex_leave(sqlite3GlobalConfig.pInitMutex);
105017 sqlite3GlobalConfig.nRefInitMutex--;
105018 if( sqlite3GlobalConfig.nRefInitMutex<=0 ){
105019 assert( sqlite3GlobalConfig.nRefInitMutex==0 );
105020 sqlite3_mutex_free(sqlite3GlobalConfig.pInitMutex);
105021 sqlite3GlobalConfig.pInitMutex = 0;
105056 if( sqlite3GlobalConfig.isInit ){
105059 sqlite3GlobalConfig.isInit = 0;
105061 if( sqlite3GlobalConfig.isPCacheInit ){
105063 sqlite3GlobalConfig.isPCacheInit = 0;
105065 if( sqlite3GlobalConfig.isMallocInit ){
105067 sqlite3GlobalConfig.isMallocInit = 0;
105069 if( sqlite3GlobalConfig.isMutexInit ){
105071 sqlite3GlobalConfig.isMutexInit = 0;
105092 if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;
105103 sqlite3GlobalConfig.bCoreMutex = 0;
105104 sqlite3GlobalConfig.bFullMutex = 0;
105110 sqlite3GlobalConfig.bCoreMutex = 1;
105111 sqlite3GlobalConfig.bFullMutex = 0;
105116 sqlite3GlobalConfig.bCoreMutex = 1;
105117 sqlite3GlobalConfig.bFullMutex = 1;
105122 sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
105127 *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
105135 sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*);
105140 if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault();
105141 *va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m;
105146 sqlite3GlobalConfig.bMemstat = va_arg(ap, int);
105151 sqlite3GlobalConfig.pScratch = va_arg(ap, void*);
105152 sqlite3GlobalConfig.szScratch = va_arg(ap, int);
105153 sqlite3GlobalConfig.nScratch = va_arg(ap, int);
105158 sqlite3GlobalConfig.pPage = va_arg(ap, void*);
105159 sqlite3GlobalConfig.szPage = va_arg(ap, int);
105160 sqlite3GlobalConfig.nPage = va_arg(ap, int);
105166 sqlite3GlobalConfig.pcache = *va_arg(ap, sqlite3_pcache_methods*);
105171 if( sqlite3GlobalConfig.pcache.xInit==0 ){
105174 *va_arg(ap, sqlite3_pcache_methods*) = sqlite3GlobalConfig.pcache;
105181 sqlite3GlobalConfig.pHeap = va_arg(ap, void*);
105182 sqlite3GlobalConfig.nHeap = va_arg(ap, int);
105183 sqlite3GlobalConfig.mnReq = va_arg(ap, int);
105185 if( sqlite3GlobalConfig.pHeap==0 ){
105191 memset(&sqlite3GlobalConfig.m, 0, sizeof(sqlite3GlobalConfig.m));
105198 sqlite3GlobalConfig.m = *sqlite3MemGetMemsys3();
105201 sqlite3GlobalConfig.m = *sqlite3MemGetMemsys5();
105209 sqlite3GlobalConfig.szLookaside = va_arg(ap, int);
105210 sqlite3GlobalConfig.nLookaside = va_arg(ap, int);
105221 ** sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*));
105224 sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t);
105225 sqlite3GlobalConfig.pLogArg = va_arg(ap, void*);
106563 if( sqlite3GlobalConfig.bCoreMutex==0 ){
106570 isThreadsafe = sqlite3GlobalConfig.bFullMutex;
106574 }else if( sqlite3GlobalConfig.sharedCacheEnabled ){
106756 setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
106757 sqlite3GlobalConfig.nLookaside);
106763 assert( db->mutex!=0 || isThreadsafe==0 || sqlite3GlobalConfig.bFullMutex==0 );
106969 testcase( sqlite3GlobalConfig.xLog!=0 );
106976 testcase( sqlite3GlobalConfig.xLog!=0 );
106983 testcase( sqlite3GlobalConfig.xLog!=0 );