Round vector_downward initial size up (#4179)
This commit is contained in:
parent
1fb6b9ee6f
commit
d798100be9
|
@ -496,12 +496,11 @@ class vector_downward {
|
|||
public:
|
||||
explicit vector_downward(size_t initial_size,
|
||||
const simple_allocator &allocator)
|
||||
: reserved_(initial_size),
|
||||
: reserved_((initial_size + sizeof(largest_scalar_t) - 1) &
|
||||
~(sizeof(largest_scalar_t) - 1)),
|
||||
buf_(allocator.allocate(reserved_)),
|
||||
cur_(buf_ + reserved_),
|
||||
allocator_(allocator) {
|
||||
assert((initial_size & (sizeof(largest_scalar_t) - 1)) == 0);
|
||||
}
|
||||
allocator_(allocator) {}
|
||||
|
||||
~vector_downward() {
|
||||
if (buf_)
|
||||
|
|
Loading…
Reference in New Issue