memory_pool read/write function