You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Throw away the least recently used tile when the tile cache is full #45
The reason finished grids are held per tile rather than per region is that an endless world has to be explorable in a fixed amount of memory. That only works if old tiles get dropped.
Description
Give the tile cache a limit on how many finished tiles it holds. When a new tile is added and the limit has been reached, drop the one that was used least recently.
Reading a tile counts as using it, not just writing one. A tile that gets read constantly must never be the one dropped.
Testing:
Assert the tile cache never holds more tiles than its limit
Assert adding a tile past the limit drops the least recently used one and not simply the oldest one added
Assert reading a tile moves it to the back of the queue so it is not the next one dropped
Assert a tile that was dropped can be generated again and put back
changed the title [-]Throw away the least recently used tile when the store is full[/-][+]Throw away the least recently used tile when the tile cache is full[/+]on Aug 22, 2026
Activity
[-]Throw away the least recently used tile when the store is full[/-][+]Throw away the least recently used tile when the tile cache is full[/+]