If numStripes is greater than maxResources, then we only create maxResources of stripes, each receiving a single resource.
If numStripes does not evenly divide maxResources, then resources are divided among stripes such that no stripe has two more resources than any other stripe.
With these two changes, poolMaxResources is guaranteed to be a true maximum of resources.
This PR builds on #15
Fixes #13
This PR has two main behavior changes:
numStripes
is greater thanmaxResources
, then we only createmaxResources
of stripes, each receiving a single resource.numStripes
does not evenly dividemaxResources
, then resources are divided among stripes such that no stripe has two more resources than any other stripe.With these two changes,
poolMaxResources
is guaranteed to be a true maximum of resources.