Inheritance diagram for Manager:
The Manager class contains and manages several pool objects. The number of managed pool objects is equal to POOL_SIZE.
The granularity argument is the difference between block sizes of the two adjacent pool objects. For example, if granularity is 2, then pools are 2, 4, 6, 8, ... bytes. If granularity is 4, then pools are 4, 8, 12, 16, ... bytes.
A | Alignment of pointers. Should be integer power of two. | |
G | Granularity of memory block sizes. Recommended 4 or 16. | |
PS | Total number of managed pool objects. | |
CS | Approximate chunk size in bytes. |
typedef pool_type::size_type size_type |
Size type.
typedef pool_type::pointer pointer |
Pointer type.
anonymous enum |
Manager | ( | ) | [inline] |
Construction.
The constructor initializes all managed pools.
~Manager | ( | ) | [inline] |
Destruction.
The destructor destroys all managed pools.
Get the memory block.
This method gets the memory block from the corresponding managed pool object.
The memory block size obj_size should be less than or equal to MAX_SIZE.
[in] | obj_size | The memory block size in bytes. |
Put the memory block.
This method puts the memory block obj back into the corresponding managed pool object.
The memory block size obj_size should be less than or equal to MAX_SIZE.
[in] | obj | The memory block. |
[in] | obj_size | The memory block size in bytes. |