>> I don't think this is true if you take closures into account. > > I hadn't thought about closures. I can see how closures can increase > the number of primitive holder objects but I don't see that they > inviolate the approach. It's possible that closures would explode the > size of the object pool to such a degree that the idea collapses under > its own weight... They don't invalidate of course, just pointed out that the cache size could be much larger, but it would not take more memory than the same number of boxed ints.
The real issue is when do you return the objects back to the cache? finalize does require garage collection. So you have a trade-off between GC + object pool operations, some sort of reference counting and GC + boxed numbers ... Seems like a wash :) > >> >> This approach would also add complexity to functions that are supposed >> to work for any object, they might have to treat the custom objects >> differently ... >> >> Boris > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---