raganwald / cafeaulife

Gosper’s HashLife in CoffeeScript
30 stars 2 forks source link

Garbage collection!!! #33

Closed raganwald closed 12 years ago

raganwald commented 12 years ago

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.
raganwald commented 12 years ago

Done, in gc.coffee. A while back!