mirror of
https://github.com/boostorg/container.git
synced 2025-08-03 22:44:26 +02:00
Allow reuse of buffer in reserve with v2 allocator
allocation_command uses expand_{fwd,bwd} flags and its result is later compared with the old pointer, but the old pointer was not passed for reuse.
This commit is contained in:
@@ -2543,7 +2543,7 @@ class vector
|
|||||||
//buffer or expand the old one.
|
//buffer or expand the old one.
|
||||||
bool same_buffer_start;
|
bool same_buffer_start;
|
||||||
size_type real_cap = 0;
|
size_type real_cap = 0;
|
||||||
pointer reuse = 0;
|
pointer reuse(this->m_holder.start());
|
||||||
pointer const ret(this->m_holder.allocation_command(allocate_new | expand_fwd | expand_bwd, new_cap, real_cap = new_cap, reuse));
|
pointer const ret(this->m_holder.allocation_command(allocate_new | expand_fwd | expand_bwd, new_cap, real_cap = new_cap, reuse));
|
||||||
|
|
||||||
//Check for forward expansion
|
//Check for forward expansion
|
||||||
|
Reference in New Issue
Block a user