summaryrefslogtreecommitdiffstats
path: root/src/trace/pool.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/trace/pool.h')
-rw-r--r--src/trace/pool.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/trace/pool.h b/src/trace/pool.h
index d072a460b..88fd82bcd 100644
--- a/src/trace/pool.h
+++ b/src/trace/pool.h
@@ -59,17 +59,21 @@ class pool {
public:
pool()
- {
+ {
cblock = 0;
size = sizeof(T) > sizeof(void *) ? sizeof(T) : sizeof(void *);
next = NULL;
- }
+ for (int k = 0; k < 64; k++) {
+ block[k] = NULL;
+ }
+ }
~pool()
- {
- for (int k = 0; k < cblock; k++)
- free(block[k]);
- }
+ {
+ for (int k = 0; k < cblock; k++) {
+ free(block[k]);
+ }
+ }
T *draw()
{
@@ -89,7 +93,7 @@ class pool {
int size;
int cblock;
- void *block[64]; //enough to store unlimited number of objects
+ void *block[64]; //enough to store unlimited number of objects, if 64 is changed: see constructor too
void *next;
void addblock()