The allocator is able to allocate and free memory in the required amount in a certain way. std::allocator -- an example of implementation of allocator from the standard library, just using new and delete, which are usually called system calls malloc and free.
A more complex example -- pool allocator. Times system calls the road, why would they not save? Select from 1 Gigabyte memory (for example), and then the allocator will provide the memory in the pool and increase the pointer head (again, simplified). Real memory allocation only one system call is almost there, hurray, hurray, the program has accelerated.
Actually, for this and need the allocator to insert their own, cool, custom, memory allocation, at any place. Most of the standard containers adopt them.
Emiliano_Becker answered on July 8th 19 at 11:29
On habré there are a number of elegant and understandable articles, such as this: