tame resource - OkCupid/sfslite GitHub Wiki

Resource Management

The hidden danger in using tame is that it's possible to leak closures. For each function wrapped with tamed, the rewritter creates and allocates a function-specific closure, capturing all arguments passed to _tame_d function, and all values declared within tvars {...}. We would want these closures to be automagically deallocated when control leaves the tamed function for the last time. And it does so long as nothing else is refering to the closure.

See the paper version of tame for more information on this.