44 #ifndef G4EnhancedVecAllocator_h
45 #define G4EnhancedVecAllocator_h 1
79 template<
typename _Tp>
84 template<
typename _Tp1>
90 : std::allocator<_Tp>() {;}
92 template<
typename _Tp1>
94 : std::allocator<_Tp>() {;}
102 _Tp*
allocate(
size_t _Count,
void *
const hint = 0);
116 template<
typename _Tp>
148 template<
typename _Tp>
151 template<
typename _Tp>
155 size_t totalsize = _Count *
sizeof(_Tp);
170 G4AllocStats::numCat++;
188 found = G4AllocStats::numCat - 1;
200 char *newSpace1 = (
char *)
malloc(totalsize * 512);
205 for (
register int k = 0; k < 512 ; k++)
209 newSpace1+totalsize*k;
239 char *newSpace = (
char *)
malloc(totalsize * 512);
244 for (
register int k = 0; k < 512 ; k++)
247 preAllocated[originalchunknumber + k]).isAllocated= 0;
249 preAllocated[originalchunknumber + k]).address= newSpace+totalsize*k;
256 preAllocated[originalchunknumber]).address);
263 template<
typename _T1,
typename _T2>
272 template<
typename _T1,
typename _T2>
~G4EnhancedVecAllocator()
bool operator!=(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
_Tp * allocate(size_t _Count)
static G4ThreadLocal G4int totSpace
G4EnhancedVecAllocator< _Tp1 > other
static G4ThreadLocal G4int numCat
G4EnhancedVecAllocator(const G4EnhancedVecAllocator< _Tp1 > &)
G4ChunkType * preAllocated
bool operator==(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
static G4ThreadLocal G4ChunkIndexType * allocStat
G4EnhancedVecAllocator(const G4EnhancedVecAllocator< _Tp > &)
void deallocate(_Tp *_Ptr, size_t _Count)
void * realloc(void *__ptr, size_t __size)
void * malloc(size_t __size)