80 typedef value_type* pointer;
81 typedef const value_type* const_pointer;
82 typedef value_type& reference;
83 typedef const value_type& const_reference;
84 typedef std::size_t size_type;
85 typedef std::ptrdiff_t difference_type;
102 region(other.region) {}
105 inline RegionAllocator(
const RegionAllocator<U> & other) :
106 region(other.region) {}
108 inline ~RegionAllocator() {}
110 inline pointer address(reference r) {
return &r; }
111 inline const_pointer address(const_reference r) {
return &r; }
113 inline pointer allocate(size_type cnt,
114 typename std::allocator<void>::const_pointer = 0) {
117 inline void deallocate(pointer p, size_type) { }
119 inline size_type max_size()
const {
120 return std::numeric_limits<size_type>::max() /
sizeof(T);
125 RegionAllocator& operator=(
const RegionAllocator<U>&) {
return *
this; }
128 inline void construct(pointer p,
const T& t) {
new(p) T(t); }
129 inline void destroy(pointer p) { p->~T(); }
131 inline bool operator==(RegionAllocator
const& a) {
return region == a.region; }
132 inline bool operator!=(RegionAllocator
const& a) {
return !operator==(a); }
140 typedef T value_type;
142 typedef std::list<T, allocator > type;
143 typedef typename type::iterator iterator;
150 typedef T value_type;
152 typedef std::vector<T, allocator > type;
153 typedef typename type::iterator iterator;
158 template<
class K,
class T,
class C=std::less<K> >
161 typedef std::pair<const K, T> value_type;
163 typedef std::map<K, T, C, allocator > type;
164 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.
Data Structure for Region-Based memory allocation.
An STL allocator that allocates out of a memory region.