Lines Matching refs:mem0

30784 } mem0 = { 0, SQLITE_MAX_MEMORY, SQLITE_MAX_MEMORY, 0 };  variable
30786 #define mem0 GLOBAL(struct Mem0Global, mem0) macro
30792 return mem0.mutex; in sqlite3MallocMutex()
30832 sqlite3_mutex_enter(mem0.mutex); in sqlite3_soft_heap_limit64()
30833 priorLimit = mem0.alarmThreshold; in sqlite3_soft_heap_limit64()
30835 sqlite3_mutex_leave(mem0.mutex); in sqlite3_soft_heap_limit64()
30838 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){ in sqlite3_soft_heap_limit64()
30839 n = mem0.hardLimit; in sqlite3_soft_heap_limit64()
30841 mem0.alarmThreshold = n; in sqlite3_soft_heap_limit64()
30843 AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed); in sqlite3_soft_heap_limit64()
30844 sqlite3_mutex_leave(mem0.mutex); in sqlite3_soft_heap_limit64()
30872 sqlite3_mutex_enter(mem0.mutex); in sqlite3_hard_heap_limit64()
30873 priorLimit = mem0.hardLimit; in sqlite3_hard_heap_limit64()
30875 mem0.hardLimit = n; in sqlite3_hard_heap_limit64()
30876 if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){ in sqlite3_hard_heap_limit64()
30877 mem0.alarmThreshold = n; in sqlite3_hard_heap_limit64()
30880 sqlite3_mutex_leave(mem0.mutex); in sqlite3_hard_heap_limit64()
30893 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); in sqlite3MallocInit()
30900 if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0)); in sqlite3MallocInit()
30910 return AtomicLoad(&mem0.nearlyFull); in sqlite3HeapNearlyFull()
30920 memset(&mem0, 0, sizeof(mem0)); in sqlite3MallocEnd()
30947 if( mem0.alarmThreshold<=0 ) return; in sqlite3MallocAlarm()
30948 sqlite3_mutex_leave(mem0.mutex); in sqlite3MallocAlarm()
30950 sqlite3_mutex_enter(mem0.mutex); in sqlite3MallocAlarm()
30978 assert( sqlite3_mutex_held(mem0.mutex) ); in mallocWithAlarm()
30989 if( mem0.alarmThreshold>0 ){ in mallocWithAlarm()
30991 if( nUsed >= mem0.alarmThreshold - nFull ){ in mallocWithAlarm()
30992 AtomicStore(&mem0.nearlyFull, 1); in mallocWithAlarm()
30994 if( mem0.hardLimit ){ in mallocWithAlarm()
30996 if( nUsed >= mem0.hardLimit - nFull ){ in mallocWithAlarm()
31003 AtomicStore(&mem0.nearlyFull, 0); in mallocWithAlarm()
31008 if( p==0 && mem0.alarmThreshold>0 ){ in mallocWithAlarm()
31051 sqlite3_mutex_enter(mem0.mutex); in sqlite3Malloc()
31053 sqlite3_mutex_leave(mem0.mutex); in sqlite3Malloc()
31146 sqlite3_mutex_enter(mem0.mutex); in sqlite3_free()
31150 sqlite3_mutex_leave(mem0.mutex); in sqlite3_free()
31278 sqlite3_mutex_enter(mem0.mutex); in sqlite3Realloc()
31282 mem0.alarmThreshold-nDiff ){ in sqlite3Realloc()
31284 if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){ in sqlite3Realloc()
31285 sqlite3_mutex_leave(mem0.mutex); in sqlite3Realloc()
31292 if( pNew==0 && mem0.alarmThreshold>0 ){ in sqlite3Realloc()
31301 sqlite3_mutex_leave(mem0.mutex); in sqlite3Realloc()