Use intrusive list to track LRU order
This commit is contained in:
parent
81671d02b8
commit
e64b4ab63b
2 changed files with 179 additions and 47 deletions
|
@ -112,7 +112,7 @@ fn try_allocate(atlas: &mut InnerAtlas, width: usize, height: usize) -> Option<A
|
|||
}
|
||||
|
||||
// Try to free least recently used allocation
|
||||
let (key, value) = atlas.glyph_cache.entries_least_recently_used().next()?;
|
||||
let (key, value) = atlas.glyph_cache.pop()?;
|
||||
atlas
|
||||
.packer
|
||||
.deallocate(value.atlas_id.expect("cache corrupt"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue