It might be better to clarify that you can pool and allocate elsewhere as long as that elsewhere is not on fast/common path. In other words, you can allocate elsewhere as long as those allocations don't trigger GCs.
Also, if the pooled objects are not reference dense and aren't themselves stored in fields of other objects (e.g. borrowed on-stack only), then they either don't incur any card marking penalty or very little. Likewise, if the number of pooled instances isn't significant, GC impact can be insignificant (assuming a GC is triggered afterall).
Generally speaking, it's impossible to be completely allocation free in anything other than trivial examples (and it's a silly goal to aim for unless this is some microcontroller/embedded space). However, should be allocation free in common/hot paths.
sent from my phone
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alex,
I would continue writing your posts as I suspect some will find them useful, whether they voice that recognition or not. But, you've mentioned several times that you want (and now lacking) feedback. What type of feedback are you interested in exactly? I may be wrong, but I suspect majority of active readers on this list (at least ones that also participate in discussions) are already familiar with the material from the two articles you've posted thus far, and may not comment one way or another. If you're gradually moving to less traveled grounds, enagement may pick up.
Anyway, just my $.02.
sent from my phone