Lines Matching refs:mem0
30270 } mem0 = { 0, SQLITE_MAX_MEMORY, SQLITE_MAX_MEMORY, 0 }; variable
30272 #define mem0 GLOBAL(struct Mem0Global, mem0) macro
30278 return mem0.mutex; in sqlite3MallocMutex()
30318 sqlite3_mutex_enter(mem0.mutex); in sqlite3_soft_heap_limit64()
30319 priorLimit = mem0.alarmThreshold; in sqlite3_soft_heap_limit64()
30321 sqlite3_mutex_leave(mem0.mutex); in sqlite3_soft_heap_limit64()
30324 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){ in sqlite3_soft_heap_limit64()
30325 n = mem0.hardLimit; in sqlite3_soft_heap_limit64()
30327 mem0.alarmThreshold = n; in sqlite3_soft_heap_limit64()
30329 AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed); in sqlite3_soft_heap_limit64()
30330 sqlite3_mutex_leave(mem0.mutex); in sqlite3_soft_heap_limit64()
30358 sqlite3_mutex_enter(mem0.mutex); in sqlite3_hard_heap_limit64()
30359 priorLimit = mem0.hardLimit; in sqlite3_hard_heap_limit64()
30361 mem0.hardLimit = n; in sqlite3_hard_heap_limit64()
30362 if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){ in sqlite3_hard_heap_limit64()
30363 mem0.alarmThreshold = n; in sqlite3_hard_heap_limit64()
30366 sqlite3_mutex_leave(mem0.mutex); in sqlite3_hard_heap_limit64()
30379 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); in sqlite3MallocInit()
30386 if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0)); in sqlite3MallocInit()
30396 return AtomicLoad(&mem0.nearlyFull); in sqlite3HeapNearlyFull()
30406 memset(&mem0, 0, sizeof(mem0)); in sqlite3MallocEnd()
30433 if( mem0.alarmThreshold<=0 ) return; in sqlite3MallocAlarm()
30434 sqlite3_mutex_leave(mem0.mutex); in sqlite3MallocAlarm()
30436 sqlite3_mutex_enter(mem0.mutex); in sqlite3MallocAlarm()
30464 assert( sqlite3_mutex_held(mem0.mutex) ); in mallocWithAlarm()
30475 if( mem0.alarmThreshold>0 ){ in mallocWithAlarm()
30477 if( nUsed >= mem0.alarmThreshold - nFull ){ in mallocWithAlarm()
30478 AtomicStore(&mem0.nearlyFull, 1); in mallocWithAlarm()
30480 if( mem0.hardLimit ){ in mallocWithAlarm()
30482 if( nUsed >= mem0.hardLimit - nFull ){ in mallocWithAlarm()
30489 AtomicStore(&mem0.nearlyFull, 0); in mallocWithAlarm()
30494 if( p==0 && mem0.alarmThreshold>0 ){ in mallocWithAlarm()
30537 sqlite3_mutex_enter(mem0.mutex); in sqlite3Malloc()
30539 sqlite3_mutex_leave(mem0.mutex); in sqlite3Malloc()
30632 sqlite3_mutex_enter(mem0.mutex); in sqlite3_free()
30636 sqlite3_mutex_leave(mem0.mutex); in sqlite3_free()
30764 sqlite3_mutex_enter(mem0.mutex); in sqlite3Realloc()
30768 mem0.alarmThreshold-nDiff ){ in sqlite3Realloc()
30770 if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){ in sqlite3Realloc()
30771 sqlite3_mutex_leave(mem0.mutex); in sqlite3Realloc()
30778 if( pNew==0 && mem0.alarmThreshold>0 ){ in sqlite3Realloc()
30787 sqlite3_mutex_leave(mem0.mutex); in sqlite3Realloc()