Home | History | Annotate | Download | only in containers

Lines Matching refs:allocator

20 // This allocator can be used with STL containers to provide a stack buffer
25 // STL likes to make copies of allocators, so the allocator itself can't hold
27 // StackAllocator::Source which contains the data. Copying the allocator
29 // based on our allocator will share the same stack buffer.
39 class StackAllocator : public std::allocator<T> {
41 typedef typename std::allocator<T>::pointer pointer;
42 typedef typename std::allocator<T>::size_type size_type;
44 // Backing store for the allocator. The container owner is responsible for
45 // maintaining this for as long as any containers using this allocator are
70 // Used by containers when they want to refer to an allocator of type U.
78 : std::allocator<T>(), source_(rhs.source_) {
95 // This constructor must exist. It creates a default allocator that doesn't
97 // current allocator against the default-constructed allocator, so this
107 // allocator.
114 return std::allocator<T>::allocate(n, hint);
119 // non-stack-buffer pointers, just fall though to the standard allocator.
124 std::allocator<T>::deallocate(p, n);
144 typedef StackAllocator<ContainedType, stack_capacity> Allocator;
146 // Allocator must be constructed before the container!
156 // shorter lifetimes than the source. The copy will share the same allocator
171 const typename Allocator::Source& stack_data() const {
177 typename Allocator::Source stack_data_;
178 Allocator allocator_;