Add functions to check efficiently if a memory pool is empty.