refactoring
fixed bug in mempool.c that lead to poor performance on mempool_grow