I have a pool allocator up and running which works OK, but the policy
I'm using (based on the following paper:
<
https://pdfs.semanticscholar.org/4321/a91d635d023ab25a743c698be219edcdb1a3.pdf>)
is only really good for allocating a single object into one block of
memory with sufficient size for it at a time.
I notice that the std::allocator template method "allocate" has a
parameter where STL containers can request a count of blocks to allocate
simultaneously. For example it looks like std::basic_string, once it
exceeds a certain size string it keeps on the stack, moves the whole
thing over to the heap at once by requesting a contiguous block of
memory from the allocator large enough to store a char array holding the
entire string.
Is there any way to adapt an allocator designed to return fixed-size
chunks the size of the type it's templated on to this sort of STL container?