19 #ifndef FOR_LIB_POOL_H
20 #define FOR_LIB_POOL_H
190 enum { defInitSize = 256, defIncSize = 64 };
192 Pool(
int anInitSize = defInitSize,
int anIncSize = defIncSize) :
193 theIncSize(anIncSize),
198 allocate(anInitSize);
203 for (
int i=0;
i <theTop ; ++
i)
212 unsigned size(){
return theTop; };
215 void allocate(
int aSize)
219 theList =
new T*[aSize+theCurrentSize];
221 for (i = 0; i < theTop; i++) {
222 theList[
i] = tList[
i];
225 for (; (theTop < aSize); theTop++){
226 theList[theTop] = (T*)
new T;
228 theCurrentSize += aSize;
248 allocate(theIncSize);
251 tmp = theList[theTop];