What does it mean for an allocator to be stateless? I realize that std::allocator is a wrapper around malloc, and has no state of its own. At the same time, malloc does its own bookkeeping, so one could say that all std::allocator instances make use of a single state.
How would I go about implementing a pool allocator without state? If not the allocator, what would keep the current state of memory?
Could someone formally define what state means in this context?
State means that the instances of class have mutable information in them. Stateless means that they do not have it. Stateless classes do not have non-static data members.
You can make pool allocator to be stateless by using some mutual external state (a pool) that is same for all pool allocators of that type.