reactor/reactor — pull request #257 by ifesdjeen (2014-01-11 16:22:06+00:00)
Title: Initial sketch of generic object pool

This implements pooling of Events. Events are pooled based
on their generic type.

Pool is implemented through the bit-set, since it should yield a better
performance than maintaining and synchronising access to two lists.

When next freely available object is required, bit-set is queried for
the next free bit position. If the position is larger than whatever the
pool has so far, new instance is created, pooled and returned.
Objects are never released.

This pull request is incomplete. I just want to gather more feedback
and continue work from there.

What's not yet done: polling of classes derived from Event.

I've noticed that there already was an implementation of Pool
already available in Reactor. Should I switch whatever I've written
to this impl? Or should we stick to BitSet?

With Queue, there's no need for storing the bit position. On the other hand,
if `free` is implemented on the object itself, there still should be link to the
pool anyways.

Looking forward to see your comments!