81 typedef value_type* pointer;
82 typedef const value_type* const_pointer;
83 typedef value_type& reference;
84 typedef const value_type& const_reference;
85 typedef std::size_t size_type;
86 typedef std::ptrdiff_t difference_type;
103 region(other.region) {}
106 inline RegionAllocator(
const RegionAllocator<U> & other) :
107 region(other.region) {}
109 inline ~RegionAllocator() {}
111 inline pointer address(reference r) {
return &r; }
112 inline const_pointer address(const_reference r) {
return &r; }
114 inline pointer allocate(size_type cnt,
115 typename std::allocator<void>::const_pointer = 0) {
118 inline void deallocate(pointer p, size_type) { }
120 inline size_type max_size()
const {
121 return std::numeric_limits<size_type>::max() /
sizeof(T);
126 RegionAllocator& operator=(
const RegionAllocator<U>&) {
return *
this; }
129 inline void construct(pointer p,
const T& t) {
new(p) T(t); }
130 inline void destroy(pointer p) { p->~T(); }
132 inline bool operator==(RegionAllocator
const& a) {
return region == a.region; }
133 inline bool operator!=(RegionAllocator
const& a) {
return !operator==(a); }
143 typedef T value_type;
145 typedef std::list<T, allocator > type;
146 typedef typename type::iterator iterator;
155 typedef T value_type;
157 typedef std::vector<T, allocator > type;
158 typedef typename type::iterator iterator;
165 template<
class K,
class T,
class C=std::less<K> >
168 typedef std::pair<const K, T> value_type;
170 typedef std::map<K, T, C, allocator > type;
171 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.
Typedefs for STL vector using region allocator.
Typedefs for STL lists using region allocator.
An STL allocator that allocates out of a memory region.