MPD
0.20.6
|
Manager for a temporary array which grows as needed. More...
#include <ReusableArray.hxx>
Public Member Functions | |
ReusableArray ()=default | |
ReusableArray (ReusableArray &&src) | |
ReusableArray & | operator= (ReusableArray &&src) |
~ReusableArray () | |
size_t | GetCapacity () const |
void | Clear () |
Free resources allocated by this object. More... | |
gcc_malloc T * | Get (size_t size) |
Get the buffer, and guarantee a minimum size. More... | |
Manager for a temporary array which grows as needed.
This attempts to reduce the number of consecutive heap allocations and deallocations.
T | the array element type |
M | always allocate multiples of this number; must be a power of 2 |
Definition at line 48 of file ReusableArray.hxx.
|
default |
|
inline |
Definition at line 55 of file ReusableArray.hxx.
|
inline |
Definition at line 65 of file ReusableArray.hxx.
|
inline |
Free resources allocated by this object.
This invalidates the buffer returned by Get().
Definition at line 77 of file ReusableArray.hxx.
|
inline |
Get the buffer, and guarantee a minimum size.
This buffer becomes invalid with the next Get() call.
Definition at line 88 of file ReusableArray.hxx.
|
inline |
Definition at line 69 of file ReusableArray.hxx.
|
inline |
Definition at line 59 of file ReusableArray.hxx.