It needs to implement the following function in this class
mpool init
inital a mem pool that can alloc/free fixed-size chunk
- input
- total_size
- chunk_size
-
mpool alloc
return a chunk from the mpool -
mpool release
release an allocted chunk -
mpopol fini
destroy the whole mem pool
For the performance, it needs to fulfill the following requirements
- Reduce memory manage overhead -
O(1)
- Efficient alloc/release() -
O(1)
use exec.sh
to compile and run the program