Improve performance by using a power-of-two number of memory pages in buffers

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>