114 typedef T value_type;
115 typedef value_type* pointer;
116 typedef const value_type* const_pointer;
117 typedef value_type& reference;
118 typedef const value_type& const_reference;
119 typedef std::size_t size_type;
120 typedef std::ptrdiff_t difference_type;
137 region(other.region) {}
141 region(other.region) {}
145 inline pointer address(reference r) {
return &r; }
146 inline const_pointer address(const_reference r) {
return &r; }
148 inline pointer allocate(size_type cnt,
149 typename std::allocator<void>::const_pointer = 0) {
152 inline void deallocate(pointer p, size_type) { }
154 inline size_type max_size()
const {
155 return std::numeric_limits<size_type>::max() /
sizeof(T);
163 inline void construct(pointer p,
const T& t) {
new(p) T(t); }
164 inline void destroy(pointer p) { p->~T(); }
166 inline bool operator==(
RegionAllocator const& a) {
return region == a.region; }
167 inline bool operator!=(
RegionAllocator const& a) {
return !operator==(a); }
177 typedef T value_type;
179 typedef std::list<T, allocator > type;
180 typedef typename type::iterator iterator;
189 typedef T value_type;
191 typedef std::vector<T, allocator > type;
192 typedef typename type::iterator iterator;
199 template<
class K,
class T,
class C=std::less<K> >
202 typedef std::pair<const K, T> value_type;
204 typedef std::map<K, T, C, allocator > type;
205 typedef typename type::iterator iterator;
AA_API void * aa_mem_region_alloc(aa_mem_region_t *region, size_t size)
Allocate size bytes from the region.
Typedefs for STL map using region allocator.
Data Structure for Region-Based memory allocation.
AA_API aa_mem_region_t * aa_mem_region_local_get(void)
Return pointer to a thread-local memory region.
Typedefs for STL vector using region allocator.
Typedefs for STL lists using region allocator.
AA_API void * aa_mem_region_ptr(aa_mem_region_t *region)
Pointer to start of free space in region.
An STL allocator that allocates out of a memory region.
AA_API void aa_mem_region_pop(aa_mem_region_t *region, void *ptr)
Deallocates ptr and all blocks allocated after ptr was allocated.