Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove deprecated and unused PolymorphicAllocator. It has been replaced by PolymorphicArenaAllocator. Restrict PODVector's Allocator to std::allocator and AMReX's various Arena based allocators. This simplifies the implementation of PODVector, because std::allocator is stateless and Arena based allocators are simple even when it's polymorphic. Fix a few issues of PODVectors with a PolymorphicArenaAllocator. For example, copy assignment operator should copy the Allocator. Copy constructor should consider the possibility that other PODVector has a different type of Arena. Add placeholders for potentially growing and shrinking memory allocation in-place that will be implemented in a follow-up PR. Update PODVector's growth strategy. Hopefully this helps to reduce the memory consumption. * Always try to grow in-place. * For assign, operator=, resize & reserve, allocate the specified size without capacity. * For push_back & emplace_back, grow the capacity by a factor that is 1.5 by default. * For insert, the capacity grows either by a factor that is 1.5 by default or to the new size, whichever is greater.
- Loading branch information