SVN r4405

Be smarter when clearing the cache.
This commit is contained in:
Allofich
2021-03-02 01:55:00 +09:00
parent 70ff114700
commit 65f8ce9ae8

View File

@@ -374,14 +374,15 @@ public:
}
void ClearRelease(void) {
// clear out all cache blocks in this page
for (Bitu index=0;index<(1+DYN_PAGE_HASH);index++) {
CacheBlockDynRec * block=hash_map[index];
while (block) {
CacheBlockDynRec * nextblock=block->hash.next;
block->page.handler=0; // no need, full clear
block->Clear();
block=nextblock;
}
Bitu count=active_blocks;
CacheBlockDynRec **map=hash_map;
for (CacheBlockDynRec * block=*map;count;count--) {
while (block==NULL)
block=*++map;
CacheBlockDynRec * nextblock=block->hash.next;
block->page.handler=0; // no need, full clear
block->Clear();
block=nextblock;
}
Release(); // now can release this page
}