Home | History | Annotate | Download | only in orig

Lines Matching refs:mem0

17712 /************** Begin file mem0.c ********************************************/
17773 /************** End of mem0.c ************************************************/
21408 } mem0 = { 0, 0, 0, 0, 0, 0 };
21410 #define mem0 GLOBAL(struct Mem0Global, mem0)
21416 return mem0.mutex;
21449 sqlite3_mutex_enter(mem0.mutex);
21450 priorLimit = mem0.alarmThreshold;
21452 sqlite3_mutex_leave(mem0.mutex);
21455 mem0.alarmThreshold = n;
21457 mem0.nearlyFull = (n>0 && n<=nUsed);
21458 sqlite3_mutex_leave(mem0.mutex);
21476 memset(&mem0, 0, sizeof(mem0));
21478 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
21488 mem0.pScratchFree = pSlot;
21489 mem0.nScratchFree = n;
21495 mem0.pScratchEnd = (void*)&pSlot[1];
21497 mem0.pScratchEnd = 0;
21508 if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
21518 return mem0.nearlyFull;
21528 memset(&mem0, 0, sizeof(mem0));
21555 if( mem0.alarmThreshold<=0 ) return;
21556 sqlite3_mutex_leave(mem0.mutex);
21558 sqlite3_mutex_enter(mem0.mutex);
21568 assert( sqlite3_mutex_held(mem0.mutex) );
21571 if( mem0.alarmThreshold>0 ){
21573 if( nUsed >= mem0.alarmThreshold - nFull ){
21574 mem0.nearlyFull = 1;
21577 mem0.nearlyFull = 0;
21582 if( p==0 && mem0.alarmThreshold>0 ){
21610 sqlite3_mutex_enter(mem0.mutex);
21612 sqlite3_mutex_leave(mem0.mutex);
21661 sqlite3_mutex_enter(mem0.mutex);
21663 if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){
21664 p = mem0.pScratchFree;
21665 mem0.pScratchFree = mem0.pScratchFree->pNext;
21666 mem0.nScratchFree--;
21668 sqlite3_mutex_leave(mem0.mutex);
21670 sqlite3_mutex_leave(mem0.mutex);
21673 sqlite3_mutex_enter(mem0.mutex);
21675 sqlite3_mutex_leave(mem0.mutex);
21679 assert( sqlite3_mutex_notheld(mem0.mutex) );
21706 if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){
21710 sqlite3_mutex_enter(mem0.mutex);
21711 pSlot->pNext = mem0.pScratchFree;
21712 mem0.pScratchFree = pSlot;
21713 mem0.nScratchFree++;
21714 assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch );
21716 sqlite3_mutex_leave(mem0.mutex);
21724 sqlite3_mutex_enter(mem0.mutex);
21729 sqlite3_mutex_leave(mem0.mutex);
21787 sqlite3_mutex_enter(mem0.mutex);
21791 sqlite3_mutex_leave(mem0.mutex);
21863 sqlite3_mutex_enter(mem0.mutex);
21867 mem0.alarmThreshold-nDiff ){
21871 if( pNew==0 && mem0.alarmThreshold>0 ){
21879 sqlite3_mutex_leave(mem0.mutex);