On Thu, May 17, 2012 at 10:29 PM, Hugh <
game...@gmail.com> wrote:
> setResult( p1.addBuf(p2,tmp1).addBuf(p3,tmp2).clone() );
> but this requires significant changes to the algorithm. Or perhaps are are
> thinking of using some magic to do this automatically?
ah, reminds me of back when i was asking on the list how i could
implicitly pass in the pool :-)
($0.02 i mucked around with a few small variations on the themes and
in the end the best thing for me and my code was to have explicitly 2
versions of a given type, 1 for gc, 1 for pooling, and the pooling one
could be constructed from the gc one, but also given a pool in the
constructor, and then the add / subtract / normalize / etc. calls
would return values out of that pool. then somebody would have to know
when to recycle things. one pool was a frame pool, just recycleAll().
in other situations i had to explicitly track when to pool.recycle(
instance ) which of course means we're back in malloc/free land which
is no fun.) (having the 2 different variants lets me experiment with
code to see where i f'd up with the use of pooling.)