Lines Matching defs: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_) {
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_;