Allocator type for GC vectors. Notice that we need the structure declaration even if GC is not enabled.
template<typename T , typename A >
void va_gc::reserve |
( |
vec< T, A, vl_embed > *& |
v, |
|
|
unsigned |
reserve, |
|
|
bool exact |
MEM_STAT_DECL |
|
) |
| |
Allocator for GC memory. Ensure there are at least RESERVE free slots in V. If EXACT is true, grow exactly, else grow exponentially. As a special case, if the vector had not been allocated and and RESERVE is 0, no vector will be created.
Calculate the amount of space we want.
Ask the allocator how much space it will really give us.
Adjust the number of slots accordingly.
And finally, recalculate the amount of space we ask for.