Home | History | Annotate | Download | only in containers

Lines Matching refs:allocator

18 // This allocator can be used with STL containers to provide a stack buffer
23 // STL likes to make copies of allocators, so the allocator itself can't hold
25 // StackAllocator::Source which contains the data. Copying the allocator
27 // based on our allocator will share the same stack buffer.
37 class StackAllocator : public std::allocator<T> {
39 typedef typename std::allocator<T>::pointer pointer;
40 typedef typename std::allocator<T>::size_type size_type;
42 // Backing store for the allocator. The container owner is responsible for
43 // maintaining this for as long as any containers using this allocator are
68 // Used by containers when they want to refer to an allocator of type U.
76 : std::allocator<T>(), source_(rhs.source_) {
93 // This constructor must exist. It creates a default allocator that doesn't
95 // current allocator against the default-constructed allocator, so this
105 // allocator.
112 return std::allocator<T>::allocate(n, hint);
117 // non-stack-buffer pointers, just fall though to the standard allocator.
122 std::allocator<T>::deallocate(p, n);
142 typedef StackAllocator<ContainedType, stack_capacity> Allocator;
144 // Allocator must be constructed before the container!
154 // shorter lifetimes than the source. The copy will share the same allocator
169 const typename Allocator::Source& stack_data() const {
175 typename Allocator::Source stack_data_;
176 Allocator allocator_;