Lines Matching full:allocator
14 // This allocator can be used with STL containers to provide a stack buffer
19 // STL likes to make copies of allocators, so the allocator itself can't hold
21 // StackAllocator::Source which contains the data. Copying the allocator
23 // based on our allocator will share the same stack buffer.
33 class StackAllocator : public std::allocator<T> {
35 typedef typename std::allocator<T>::pointer pointer;
36 typedef typename std::allocator<T>::size_type size_type;
38 // Backing store for the allocator. The container owner is responsible for
39 // 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_) {
98 // allocator.
105 return std::allocator<T>::allocate(n, hint);
110 // non-stack-buffer pointers, just fall though to the standard allocator.
115 std::allocator<T>::deallocate(p, n);
135 typedef StackAllocator<ContainedType, stack_capacity> Allocator;
137 // Allocator must be constructed before the container!
147 // shorter lifetimes than the source. The copy will share the same allocator
162 const typename Allocator::Source& stack_data() const {
168 typename Allocator::Source stack_data_;
169 Allocator allocator_;