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>
137 if ( (chunk.
preAllocated[k]).address == ((
char *) _Ptr))
151 template<
typename _Tp>
154 template<
typename _Tp>
158 size_t totalsize = _Count *
sizeof(_Tp);
205 char *newSpace1 = (
char *) malloc(totalsize * 512);
210 for (
G4int k = 0; k < 512 ; k++)
213 (chunk.
preAllocated[k]).address = newSpace1+totalsize*k;
243 char *newSpace = (
char *) malloc(totalsize * 512);
248 for (
G4int k = 0; k < 512 ; k++)
250 (chunk.
preAllocated[originalchunknumber+k]).isAllocated = 0;
251 (chunk.
preAllocated[originalchunknumber+k]).address = newSpace+totalsize*k;
254 (chunk.
preAllocated[originalchunknumber]).isAllocated = 1;
256 return (_Tp*)((chunk.
preAllocated[originalchunknumber]).address);
263 template<
typename _T1,
typename _T2>
272 template<
typename _T1,
typename _T2>
static G4ThreadLocal G4int totSpace
G4EnhancedVecAllocator(const G4EnhancedVecAllocator< _Tp > &)
_Tp * allocate(size_t _Count)
void deallocate(_Tp *_Ptr, size_t _Count)
static G4ThreadLocal G4int numCat
bool operator!=(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
static G4ThreadLocal G4ChunkIndexType * allocStat
G4EnhancedVecAllocator(const G4EnhancedVecAllocator< _Tp1 > &)
bool operator==(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
G4EnhancedVecAllocator< _Tp1 > other
~G4EnhancedVecAllocator()
G4ChunkType * preAllocated