mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
SVN r4405
Be smarter when clearing the cache.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user