raganwald/cafeaulife — Issue #33: Garbage collection!!!
Author: raganwald
Created: 2012-02-20 22:42:38+00:00
State: open

Need to be able to compute “rabbits” without going over 900,000 squares in the cache. Some options:

1. Roll your own weak references. They act like squares, but don’t remember results
2. Cache results but not squares, you can GC a bunch of results, which would discard a bunch of squares not currently ‘pinned’ by the current computation.
3. Figure out a ‘pinned’ vs. ‘unpinned’ flag for the cache, such that the current square is always pinned, and so are the initial rules, but other squares can be discarded. Critical to be able to force that any pinned square also pins its components, but nothing else is pinned. This allows for temporary results to be subject to GC.