46 #define G4Allocator_h 1
118 pointer
address(reference r)
const {
return &r; }
119 const_pointer
address(const_reference r)
const {
return &r; }
130 mem_alloc =
static_cast<Type*
>(::operator
new(n*
sizeof(Type)));
140 ::operator
delete((
void*)p);
144 void construct(pointer p,
const Type& val) {
new((
void*)p) Type(val); }
153 return 2147483647/
sizeof(Type);
181 template <
class Type>
185 tname =
typeid(Type).
name();
192 template <
class Type>
201 template <
class Type>
204 return static_cast<Type*
>(mem.Alloc());
211 template <
class Type>
222 template <
class Type>
235 template <
class Type>
245 template <
class Type>
248 return mem.GetNoPages();
255 template <
class Type>
258 return mem.GetPageSize();
265 template <
class Type>
269 mem.GrowPageSize(sz);
276 template <
class Type>
286 template <
class T1,
class T2>
296 template <
class T1,
class T2>
bool operator!=(const G4Allocator< T1 > &, const G4Allocator< T2 > &)
size_t GetAllocatedSize() const
virtual void IncreasePageSize(unsigned int sz)=0
ptrdiff_t difference_type
virtual size_t GetAllocatedSize() const =0
size_type max_size() const
void FreeSingle(Type *anElement)
void construct(pointer p, const Type &val)
void deallocate(pointer p, size_type n)
virtual void ResetStorage()=0
virtual int GetNoPages() const =0
virtual size_t GetPageSize() const =0
G4Allocator(const G4Allocator< U > &right)
const char * GetPoolType() const
const Type * const_pointer
const_pointer address(const_reference r) const
bool operator==(const G4Allocator< T1 > &, const G4Allocator< T2 > &)
size_t GetPageSize() const
pointer address(reference r) const
virtual const char * GetPoolType() const =0
pointer allocate(size_type n, void *=0)
const Type & const_reference
virtual ~G4AllocatorBase()
void IncreasePageSize(unsigned int sz)