Lines Matching refs:pGroup
182 PGroup *pGroup; /* PGroup this cache belongs to */ member
436 assert( sqlite3_mutex_held(pCache->pGroup->mutex) ); in pcache1AllocPage()
448 assert( pCache->pGroup==&pcache1.grp ); in pcache1AllocPage()
449 pcache1LeaveMutex(pCache->pGroup); in pcache1AllocPage()
455 pcache1EnterMutex(pCache->pGroup); in pcache1AllocPage()
476 assert( sqlite3_mutex_held(p->pCache->pGroup->mutex) ); in pcache1FreePage()
542 assert( sqlite3_mutex_held(p->pGroup->mutex) ); in pcache1ResizeHash()
549 pcache1LeaveMutex(p->pGroup); in pcache1ResizeHash()
553 pcache1EnterMutex(p->pGroup); in pcache1ResizeHash()
583 assert( sqlite3_mutex_held(pPage->pCache->pGroup->mutex) ); in pcache1PinPage()
590 assert( pPage->pCache->pGroup->lru.isAnchor==1 ); in pcache1PinPage()
608 assert( sqlite3_mutex_held(pCache->pGroup->mutex) ); in pcache1RemoveFromHash()
622 PGroup *pGroup = pCache->pGroup; in pcache1EnforceMaxPage() local
624 assert( sqlite3_mutex_held(pGroup->mutex) ); in pcache1EnforceMaxPage()
625 while( pGroup->nPurgeable>pGroup->nMaxPage in pcache1EnforceMaxPage()
626 && (p=pGroup->lru.pLruPrev)->isAnchor==0 in pcache1EnforceMaxPage()
628 assert( p->pCache->pGroup==pGroup ); in pcache1EnforceMaxPage()
652 assert( sqlite3_mutex_held(pCache->pGroup->mutex) ); in pcache1TruncateUnsafe()
766 PGroup *pGroup; /* The group the new page cache will belong to */ in pcache1Create() local
776 pGroup = (PGroup*)&pCache[1]; in pcache1Create()
777 pGroup->mxPinned = 10; in pcache1Create()
779 pGroup = &pcache1.grp; in pcache1Create()
781 pcache1EnterMutex(pGroup); in pcache1Create()
782 if( pGroup->lru.isAnchor==0 ){ in pcache1Create()
783 pGroup->lru.isAnchor = 1; in pcache1Create()
784 pGroup->lru.pLruPrev = pGroup->lru.pLruNext = &pGroup->lru; in pcache1Create()
786 pCache->pGroup = pGroup; in pcache1Create()
794 pGroup->nMinPage += pCache->nMin; in pcache1Create()
795 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage; in pcache1Create()
796 pCache->pnPurgeable = &pGroup->nPurgeable; in pcache1Create()
800 pcache1LeaveMutex(pGroup); in pcache1Create()
819 PGroup *pGroup = pCache->pGroup; in pcache1Cachesize() local
820 pcache1EnterMutex(pGroup); in pcache1Cachesize()
822 if( n > 0x7fff0000 - pGroup->nMaxPage + pCache->nMax ){ in pcache1Cachesize()
823 n = 0x7fff0000 - pGroup->nMaxPage + pCache->nMax; in pcache1Cachesize()
825 pGroup->nMaxPage += (n - pCache->nMax); in pcache1Cachesize()
826 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage; in pcache1Cachesize()
830 pcache1LeaveMutex(pGroup); in pcache1Cachesize()
842 PGroup *pGroup = pCache->pGroup; in pcache1Shrink() local
844 pcache1EnterMutex(pGroup); in pcache1Shrink()
845 savedMaxPage = pGroup->nMaxPage; in pcache1Shrink()
846 pGroup->nMaxPage = 0; in pcache1Shrink()
848 pGroup->nMaxPage = savedMaxPage; in pcache1Shrink()
849 pcache1LeaveMutex(pGroup); in pcache1Shrink()
859 pcache1EnterMutex(pCache->pGroup); in pcache1Pagecount()
861 pcache1LeaveMutex(pCache->pGroup); in pcache1Pagecount()
880 PGroup *pGroup = pCache->pGroup; in pcache1FetchStage2() local
886 assert( pGroup->mxPinned == pGroup->nMaxPage + 10 - pGroup->nMinPage ); in pcache1FetchStage2()
889 nPinned>=pGroup->mxPinned in pcache1FetchStage2()
901 && !pGroup->lru.pLruPrev->isAnchor in pcache1FetchStage2()
905 pPage = pGroup->lru.pLruPrev; in pcache1FetchStage2()
914 pGroup->nPurgeable -= (pOther->bPurgeable - pCache->bPurgeable); in pcache1FetchStage2()
1040 pcache1EnterMutex(pCache->pGroup); in pcache1FetchWithMutex()
1043 pcache1LeaveMutex(pCache->pGroup); in pcache1FetchWithMutex()
1063 if( pCache->pGroup->mutex ){ in pcache1Fetch()
1085 PGroup *pGroup = pCache->pGroup; in pcache1Unpin() local
1088 pcache1EnterMutex(pGroup); in pcache1Unpin()
1096 if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){ in pcache1Unpin()
1100 PgHdr1 **ppFirst = &pGroup->lru.pLruNext; in pcache1Unpin()
1101 pPage->pLruPrev = &pGroup->lru; in pcache1Unpin()
1107 pcache1LeaveMutex(pCache->pGroup); in pcache1Unpin()
1127 pcache1EnterMutex(pCache->pGroup); in pcache1Rekey()
1146 pcache1LeaveMutex(pCache->pGroup); in pcache1Rekey()
1158 pcache1EnterMutex(pCache->pGroup); in pcache1Truncate()
1163 pcache1LeaveMutex(pCache->pGroup); in pcache1Truncate()
1173 PGroup *pGroup = pCache->pGroup; in pcache1Destroy() local
1175 pcache1EnterMutex(pGroup); in pcache1Destroy()
1177 assert( pGroup->nMaxPage >= pCache->nMax ); in pcache1Destroy()
1178 pGroup->nMaxPage -= pCache->nMax; in pcache1Destroy()
1179 assert( pGroup->nMinPage >= pCache->nMin ); in pcache1Destroy()
1180 pGroup->nMinPage -= pCache->nMin; in pcache1Destroy()
1181 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage; in pcache1Destroy()
1183 pcache1LeaveMutex(pGroup); in pcache1Destroy()