Lines Matching defs:mem0

25403 /************** Begin file mem0.c ********************************************/
25464 /************** End of mem0.c ************************************************/
29096 } mem0 = { 0, SQLITE_MAX_MEMORY, SQLITE_MAX_MEMORY, 0 };
29098 #define mem0 GLOBAL(struct Mem0Global, mem0)
29104 return mem0.mutex;
29144 sqlite3_mutex_enter(mem0.mutex);
29145 priorLimit = mem0.alarmThreshold;
29147 sqlite3_mutex_leave(mem0.mutex);
29150 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){
29151 n = mem0.hardLimit;
29153 mem0.alarmThreshold = n;
29155 AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
29156 sqlite3_mutex_leave(mem0.mutex);
29184 sqlite3_mutex_enter(mem0.mutex);
29185 priorLimit = mem0.hardLimit;
29187 mem0.hardLimit = n;
29188 if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){
29189 mem0.alarmThreshold = n;
29192 sqlite3_mutex_leave(mem0.mutex);
29205 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
29212 if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
29222 return AtomicLoad(&mem0.nearlyFull);
29232 memset(&mem0, 0, sizeof(mem0));
29259 if( mem0.alarmThreshold<=0 ) return;
29260 sqlite3_mutex_leave(mem0.mutex);
29262 sqlite3_mutex_enter(mem0.mutex);
29272 assert( sqlite3_mutex_held(mem0.mutex) );
29283 if( mem0.alarmThreshold>0 ){
29285 if( nUsed >= mem0.alarmThreshold - nFull ){
29286 AtomicStore(&mem0.nearlyFull, 1);
29288 if( mem0.hardLimit ){
29290 if( nUsed >= mem0.hardLimit - nFull ){
29296 AtomicStore(&mem0.nearlyFull, 0);
29301 if( p==0 && mem0.alarmThreshold>0 ){
29344 sqlite3_mutex_enter(mem0.mutex);
29346 sqlite3_mutex_leave(mem0.mutex);
29439 sqlite3_mutex_enter(mem0.mutex);
29443 sqlite3_mutex_leave(mem0.mutex);
29571 sqlite3_mutex_enter(mem0.mutex);
29575 mem0.alarmThreshold-nDiff ){
29577 if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
29578 sqlite3_mutex_leave(mem0.mutex);
29584 if( pNew==0 && mem0.alarmThreshold>0 ){
29593 sqlite3_mutex_leave(mem0.mutex);