Lines Matching defs:mem0

26577 /************** Begin file mem0.c ********************************************/
26638 /************** End of mem0.c ************************************************/
30270 } mem0 = { 0, SQLITE_MAX_MEMORY, SQLITE_MAX_MEMORY, 0 };
30272 #define mem0 GLOBAL(struct Mem0Global, mem0)
30278 return mem0.mutex;
30318 sqlite3_mutex_enter(mem0.mutex);
30319 priorLimit = mem0.alarmThreshold;
30321 sqlite3_mutex_leave(mem0.mutex);
30324 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){
30325 n = mem0.hardLimit;
30327 mem0.alarmThreshold = n;
30329 AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
30330 sqlite3_mutex_leave(mem0.mutex);
30358 sqlite3_mutex_enter(mem0.mutex);
30359 priorLimit = mem0.hardLimit;
30361 mem0.hardLimit = n;
30362 if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){
30363 mem0.alarmThreshold = n;
30366 sqlite3_mutex_leave(mem0.mutex);
30379 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
30386 if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
30396 return AtomicLoad(&mem0.nearlyFull);
30406 memset(&mem0, 0, sizeof(mem0));
30433 if( mem0.alarmThreshold<=0 ) return;
30434 sqlite3_mutex_leave(mem0.mutex);
30436 sqlite3_mutex_enter(mem0.mutex);
30464 assert( sqlite3_mutex_held(mem0.mutex) );
30475 if( mem0.alarmThreshold>0 ){
30477 if( nUsed >= mem0.alarmThreshold - nFull ){
30478 AtomicStore(&mem0.nearlyFull, 1);
30480 if( mem0.hardLimit ){
30482 if( nUsed >= mem0.hardLimit - nFull ){
30489 AtomicStore(&mem0.nearlyFull, 0);
30494 if( p==0 && mem0.alarmThreshold>0 ){
30537 sqlite3_mutex_enter(mem0.mutex);
30539 sqlite3_mutex_leave(mem0.mutex);
30632 sqlite3_mutex_enter(mem0.mutex);
30636 sqlite3_mutex_leave(mem0.mutex);
30764 sqlite3_mutex_enter(mem0.mutex);
30768 mem0.alarmThreshold-nDiff ){
30770 if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
30771 sqlite3_mutex_leave(mem0.mutex);
30778 if( pNew==0 && mem0.alarmThreshold>0 ){
30787 sqlite3_mutex_leave(mem0.mutex);