mem0 20588 ext/sqlite3/libsqlite/sqlite3.c } mem0 = { 0, 0, 0, 0, 0, 0, 0, 0 }; mem0 20590 ext/sqlite3/libsqlite/sqlite3.c #define mem0 GLOBAL(struct Mem0Global, mem0) mem0 20596 ext/sqlite3/libsqlite/sqlite3.c return mem0.mutex; mem0 20622 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20623 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmCallback = xCallback; mem0 20624 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmArg = pArg; mem0 20625 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmThreshold = iThreshold; mem0 20627 ext/sqlite3/libsqlite/sqlite3.c mem0.nearlyFull = (iThreshold>0 && iThreshold<=nUsed); mem0 20628 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20657 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20658 ext/sqlite3/libsqlite/sqlite3.c priorLimit = mem0.alarmThreshold; mem0 20659 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20683 ext/sqlite3/libsqlite/sqlite3.c memset(&mem0, 0, sizeof(mem0)); mem0 20685 ext/sqlite3/libsqlite/sqlite3.c mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); mem0 20695 ext/sqlite3/libsqlite/sqlite3.c mem0.pScratchFree = pSlot; mem0 20696 ext/sqlite3/libsqlite/sqlite3.c mem0.nScratchFree = n; mem0 20702 ext/sqlite3/libsqlite/sqlite3.c mem0.pScratchEnd = (void*)&pSlot[1]; mem0 20704 ext/sqlite3/libsqlite/sqlite3.c mem0.pScratchEnd = 0; mem0 20716 ext/sqlite3/libsqlite/sqlite3.c if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0)); mem0 20726 ext/sqlite3/libsqlite/sqlite3.c return mem0.nearlyFull; mem0 20736 ext/sqlite3/libsqlite/sqlite3.c memset(&mem0, 0, sizeof(mem0)); mem0 20770 ext/sqlite3/libsqlite/sqlite3.c if( mem0.alarmCallback==0 ) return; mem0 20771 ext/sqlite3/libsqlite/sqlite3.c xCallback = mem0.alarmCallback; mem0 20773 ext/sqlite3/libsqlite/sqlite3.c pArg = mem0.alarmArg; mem0 20774 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmCallback = 0; mem0 20775 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20777 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20778 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmCallback = xCallback; mem0 20779 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmArg = pArg; mem0 20789 ext/sqlite3/libsqlite/sqlite3.c assert( sqlite3_mutex_held(mem0.mutex) ); mem0 20792 ext/sqlite3/libsqlite/sqlite3.c if( mem0.alarmCallback!=0 ){ mem0 20794 ext/sqlite3/libsqlite/sqlite3.c if( nUsed >= mem0.alarmThreshold - nFull ){ mem0 20795 ext/sqlite3/libsqlite/sqlite3.c mem0.nearlyFull = 1; mem0 20798 ext/sqlite3/libsqlite/sqlite3.c mem0.nearlyFull = 0; mem0 20803 ext/sqlite3/libsqlite/sqlite3.c if( p==0 && mem0.alarmCallback ){ mem0 20831 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20833 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20882 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20884 ext/sqlite3/libsqlite/sqlite3.c if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){ mem0 20885 ext/sqlite3/libsqlite/sqlite3.c p = mem0.pScratchFree; mem0 20886 ext/sqlite3/libsqlite/sqlite3.c mem0.pScratchFree = mem0.pScratchFree->pNext; mem0 20887 ext/sqlite3/libsqlite/sqlite3.c mem0.nScratchFree--; mem0 20889 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20891 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20894 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20896 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20900 ext/sqlite3/libsqlite/sqlite3.c assert( sqlite3_mutex_notheld(mem0.mutex) ); mem0 20927 ext/sqlite3/libsqlite/sqlite3.c if( p>=sqlite3GlobalConfig.pScratch && p<mem0.pScratchEnd ){ mem0 20931 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20932 ext/sqlite3/libsqlite/sqlite3.c pSlot->pNext = mem0.pScratchFree; mem0 20933 ext/sqlite3/libsqlite/sqlite3.c mem0.pScratchFree = pSlot; mem0 20934 ext/sqlite3/libsqlite/sqlite3.c mem0.nScratchFree++; mem0 20935 ext/sqlite3/libsqlite/sqlite3.c assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch ); mem0 20937 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 20945 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 20950 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 21007 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 21011 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex); mem0 21083 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_enter(mem0.mutex); mem0 21087 ext/sqlite3/libsqlite/sqlite3.c mem0.alarmThreshold-nDiff ){ mem0 21091 ext/sqlite3/libsqlite/sqlite3.c if( pNew==0 && mem0.alarmCallback ){ mem0 21099 ext/sqlite3/libsqlite/sqlite3.c sqlite3_mutex_leave(mem0.mutex);