STL 컨테이너를 직접 구현하다보면 STL 컨테이너의 constructor에 allocator가 있다는 사실을 알게된다. 그런데 정작 컨테이너를 직접 사용하면서 allocator를 사용해본 경험은 아마 이 글을 읽는 대부분이 없을 것이다. C++에서 allocator는 어떤 역할을 하는 녀석일까?

allocator 가 등장한 배경

default allocator

custom allocator

https://en.cppreference.com/w/cpp/named_req/Allocator

https://www.sjbrown.co.uk/posts/pooled-allocators-for-the-stl/

reference

https://www.sjbrown.co.uk/posts/pooled-allocators-for-the-stl/