37 #ifndef G4EnhancedVecAllocator_h
38 #define G4EnhancedVecAllocator_h 1
70 template<
typename _Tp>
75 template<
typename _Tp1>
81 : std::allocator<_Tp>() {;}
83 template<
typename _Tp1>
85 : std::allocator<_Tp>() {;}
93 _Tp*
allocate(
size_t _Count,
void *
const hint = 0);
107 template<
typename _Tp>
142 template<
typename _Tp>
145 template<
typename _Tp>
149 size_t totalsize = _Count *
sizeof(_Tp);
196 char *newSpace1 = (
char *) malloc(totalsize * 512);
201 for (
auto k = 0;
k < 512 ; ++
k)
234 char *newSpace = (
char *) malloc(totalsize * 512);
239 for (
auto k = 0;
k < 512 ; ++
k)
242 (chunk.
preAllocated[originalchunknumber+
k]).address = newSpace+totalsize*
k;
245 (chunk.
preAllocated[originalchunknumber]).isAllocated = 1;
247 return (_Tp*)((chunk.
preAllocated[originalchunknumber]).address);
254 template<
typename _T1,
typename _T2>
263 template<
typename _T1,
typename _T2>