Implementing some memory allocators and testing by simulation