mem0             18083 sqlite3/libsqlite/sqlite3.c } mem0 = { 0, 0, 0, 0, 0, 0, 0, 0 };
mem0             18085 sqlite3/libsqlite/sqlite3.c #define mem0 GLOBAL(struct Mem0Global, mem0)
mem0             18110 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_enter(mem0.mutex);
mem0             18111 sqlite3/libsqlite/sqlite3.c   mem0.alarmCallback = xCallback;
mem0             18112 sqlite3/libsqlite/sqlite3.c   mem0.alarmArg = pArg;
mem0             18113 sqlite3/libsqlite/sqlite3.c   mem0.alarmThreshold = iThreshold;
mem0             18115 sqlite3/libsqlite/sqlite3.c   mem0.nearlyFull = (iThreshold>0 && iThreshold<=nUsed);
mem0             18116 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_leave(mem0.mutex);
mem0             18144 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_enter(mem0.mutex);
mem0             18145 sqlite3/libsqlite/sqlite3.c   priorLimit = mem0.alarmThreshold;
mem0             18146 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_leave(mem0.mutex);
mem0             18169 sqlite3/libsqlite/sqlite3.c   memset(&mem0, 0, sizeof(mem0));
mem0             18171 sqlite3/libsqlite/sqlite3.c     mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
mem0             18181 sqlite3/libsqlite/sqlite3.c     mem0.pScratchFree = pSlot;
mem0             18182 sqlite3/libsqlite/sqlite3.c     mem0.nScratchFree = n;
mem0             18188 sqlite3/libsqlite/sqlite3.c     mem0.pScratchEnd = (void*)&pSlot[1];
mem0             18190 sqlite3/libsqlite/sqlite3.c     mem0.pScratchEnd = 0;
mem0             18210 sqlite3/libsqlite/sqlite3.c   return mem0.nearlyFull;
mem0             18220 sqlite3/libsqlite/sqlite3.c   memset(&mem0, 0, sizeof(mem0));
mem0             18254 sqlite3/libsqlite/sqlite3.c   if( mem0.alarmCallback==0 ) return;
mem0             18255 sqlite3/libsqlite/sqlite3.c   xCallback = mem0.alarmCallback;
mem0             18257 sqlite3/libsqlite/sqlite3.c   pArg = mem0.alarmArg;
mem0             18258 sqlite3/libsqlite/sqlite3.c   mem0.alarmCallback = 0;
mem0             18259 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_leave(mem0.mutex);
mem0             18261 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_enter(mem0.mutex);
mem0             18262 sqlite3/libsqlite/sqlite3.c   mem0.alarmCallback = xCallback;
mem0             18263 sqlite3/libsqlite/sqlite3.c   mem0.alarmArg = pArg;
mem0             18273 sqlite3/libsqlite/sqlite3.c   assert( sqlite3_mutex_held(mem0.mutex) );
mem0             18276 sqlite3/libsqlite/sqlite3.c   if( mem0.alarmCallback!=0 ){
mem0             18278 sqlite3/libsqlite/sqlite3.c     if( nUsed >= mem0.alarmThreshold - nFull ){
mem0             18279 sqlite3/libsqlite/sqlite3.c       mem0.nearlyFull = 1;
mem0             18282 sqlite3/libsqlite/sqlite3.c       mem0.nearlyFull = 0;
mem0             18287 sqlite3/libsqlite/sqlite3.c   if( p==0 && mem0.alarmCallback ){
mem0             18317 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_enter(mem0.mutex);
mem0             18319 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_leave(mem0.mutex);
mem0             18362 sqlite3/libsqlite/sqlite3.c   sqlite3_mutex_enter(mem0.mutex);
mem0             18363 sqlite3/libsqlite/sqlite3.c   if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){
mem0             18364 sqlite3/libsqlite/sqlite3.c     p = mem0.pScratchFree;
mem0             18365 sqlite3/libsqlite/sqlite3.c     mem0.pScratchFree = mem0.pScratchFree->pNext;
mem0             18366 sqlite3/libsqlite/sqlite3.c     mem0.nScratchFree--;
mem0             18369 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_leave(mem0.mutex);
mem0             18375 sqlite3/libsqlite/sqlite3.c       sqlite3_mutex_leave(mem0.mutex);
mem0             18377 sqlite3/libsqlite/sqlite3.c       sqlite3_mutex_leave(mem0.mutex);
mem0             18382 sqlite3/libsqlite/sqlite3.c   assert( sqlite3_mutex_notheld(mem0.mutex) );
mem0             18408 sqlite3/libsqlite/sqlite3.c     if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){
mem0             18412 sqlite3/libsqlite/sqlite3.c       sqlite3_mutex_enter(mem0.mutex);
mem0             18413 sqlite3/libsqlite/sqlite3.c       pSlot->pNext = mem0.pScratchFree;
mem0             18414 sqlite3/libsqlite/sqlite3.c       mem0.pScratchFree = pSlot;
mem0             18415 sqlite3/libsqlite/sqlite3.c       mem0.nScratchFree++;
mem0             18416 sqlite3/libsqlite/sqlite3.c       assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch );
mem0             18418 sqlite3/libsqlite/sqlite3.c       sqlite3_mutex_leave(mem0.mutex);
mem0             18426 sqlite3/libsqlite/sqlite3.c         sqlite3_mutex_enter(mem0.mutex);
mem0             18431 sqlite3/libsqlite/sqlite3.c         sqlite3_mutex_leave(mem0.mutex);
mem0             18479 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_enter(mem0.mutex);
mem0             18483 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_leave(mem0.mutex);
mem0             18540 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_enter(mem0.mutex);
mem0             18544 sqlite3/libsqlite/sqlite3.c           mem0.alarmThreshold-nDiff ){
mem0             18550 sqlite3/libsqlite/sqlite3.c     if( pNew==0 && mem0.alarmCallback ){
mem0             18558 sqlite3/libsqlite/sqlite3.c     sqlite3_mutex_leave(mem0.mutex);