Lines Matching refs:mem0

15562 /************** Begin file mem0.c ********************************************/
15622 /************** End of mem0.c ************************************************/
18815 ** The alarm callback and its arguments. The mem0.mutex lock will
18839 } mem0 = { 0, 0, 0, 0, 0, 0, 0, 0 };
18841 #define mem0 GLOBAL(struct Mem0Global, mem0)
18866 sqlite3_mutex_enter(mem0.mutex);
18867 mem0.alarmCallback = xCallback;
18868 mem0.alarmArg = pArg;
18869 mem0.alarmThreshold = iThreshold;
18871 mem0.nearlyFull = (iThreshold>0 && iThreshold<=nUsed);
18872 sqlite3_mutex_leave(mem0.mutex);
18901 sqlite3_mutex_enter(mem0.mutex);
18902 priorLimit = mem0.alarmThreshold;
18903 sqlite3_mutex_leave(mem0.mutex);
18926 memset(&mem0, 0, sizeof(mem0));
18928 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
18938 mem0.pScratchFree = pSlot;
18939 mem0.nScratchFree = n;
18945 mem0.pScratchEnd = (void*)&pSlot[1];
18947 mem0.pScratchEnd = 0;
18967 return mem0.nearlyFull;
18977 memset(&mem0, 0, sizeof(mem0));
19011 if( mem0.alarmCallback==0 ) return;
19012 xCallback = mem0.alarmCallback;
19014 pArg = mem0.alarmArg;
19015 mem0.alarmCallback = 0;
19016 sqlite3_mutex_leave(mem0.mutex);
19018 sqlite3_mutex_enter(mem0.mutex);
19019 mem0.alarmCallback = xCallback;
19020 mem0.alarmArg = pArg;
19030 assert( sqlite3_mutex_held(mem0.mutex) );
19033 if( mem0.alarmCallback!=0 ){
19035 if( nUsed >= mem0.alarmThreshold - nFull ){
19036 mem0.nearlyFull = 1;
19039 mem0.nearlyFull = 0;
19044 if( p==0 && mem0.alarmCallback ){
19074 sqlite3_mutex_enter(mem0.mutex);
19076 sqlite3_mutex_leave(mem0.mutex);
19119 sqlite3_mutex_enter(mem0.mutex);
19120 if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){
19121 p = mem0.pScratchFree;
19122 mem0.pScratchFree = mem0.pScratchFree->pNext;
19123 mem0.nScratchFree--;
19126 sqlite3_mutex_leave(mem0.mutex);
19132 sqlite3_mutex_leave(mem0.mutex);
19134 sqlite3_mutex_leave(mem0.mutex);
19139 assert( sqlite3_mutex_notheld(mem0.mutex) );
19165 if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){
19169 sqlite3_mutex_enter(mem0.mutex);
19170 pSlot->pNext = mem0.pScratchFree;
19171 mem0.pScratchFree = pSlot;
19172 mem0.nScratchFree++;
19173 assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch );
19175 sqlite3_mutex_leave(mem0.mutex);
19183 sqlite3_mutex_enter(mem0.mutex);
19188 sqlite3_mutex_leave(mem0.mutex);
19236 sqlite3_mutex_enter(mem0.mutex);
19240 sqlite3_mutex_leave(mem0.mutex);
19301 sqlite3_mutex_enter(mem0.mutex);
19305 mem0.alarmThreshold-nDiff ){
19311 if( pNew==0 && mem0.alarmCallback ){
19319 sqlite3_mutex_leave(mem0.mutex);