Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Switch to an allocator model similar to the STL. This required updating List, Vector, and SharedPtr, the current allocator clients.
Users of allocators should generally indirect their operations through AllocTraits. This allows user-provided allocators to provide a minimal set of basis operations (AllocBytes + FreeBytes, or Alloc + Free), while letting the remainder of the operations to be given sane defaults. This PR's approach to allocators deviates from the STL, in that allocator types aren't required to be templated on the value type. This makes allocator implementations more approachable, avoids the need to rebind, and can even help build throughput due to fewer template instantiations.
This PR also provides StdAllocator, a radiant allocator that forwards to std::allocator. This both provides an example of an allocator with all the features turned on, as well as provide the path to constexpr containers, if we want to go down that path. There are multiple test allocators (like Mallocator) that demonstrate the minimal interface.
There are some drive-by fixes / changes to List and Vector. There were missing self-assignment / self-splicing checks before hand. Vector also didn't have a move ctor, but did have an allocator move ctor. Also I fixed one of the many FalseTypes.
Useful background reading on implementing allocators: https://thephd.dev/allocator-hell-small_bit_vector .