4 ms·
Always look at the memory management story when you stumble upon something like this.
by davidgrenier 9y ago
Always look at the memory management story when you stumble upon something like this.
- agentgt 9y agoYou could have provided a link to the memory management section or even mentioned it was ref counting. Otherwise your comment is ... it kills me to say this but pretty useless.
- tedunangst 9y agoAlways look at memory management is more general, and perhaps even more useful, advice than look at the memory management for this one project.
- jonathonf 9y agoWhy? What's "good" vs what's "bad"?
- mtm 9y agoIt seems well thought out: * malloc/free (ref counting GC) * memory pooling (no heap, stack-based for memory constrained systems) * third party allocators * third party GC Details here: http://ferret-lang.org/#sec-4-2 http://ferret-lang.org/#sec-4-2
- tomsmeding 9y agoI love the idea of ref counting, but I'm unsure about the handling of memory cycles. In a plain ref counting implementation, these will not be cleaned up, resulting in a memory leak. I didn't find anything on cycles in the linked page, maybe the problem is not relevant in most real-world clojure code?
- derefr 9y agoI don't know about "pure" Clojure (as this is), but in "pure" Erlang (which has similar semantics), you simply can't make a reference cycle. Functional languages in general don't really allow them.
- nakkaya 9y agoAuthor here. As derefr said with Clojure semantics you can not create cycles.
- tomsmeding 9y agoThanks, now I think about it, that makes a lot of sense.