Fix pool bug.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 5322105303
commit 77b19f6d82

@ -110,6 +110,7 @@ void *PoolGet(Pool *p) {
p->empty_list_size++; p->empty_list_size++;
} else { } else {
if (p->allocated < p->max_buckets) { if (p->allocated < p->max_buckets) {
p->allocated++;
return p->Alloc(p->AllocData); return p->Alloc(p->AllocData);
} else { } else {
return NULL; return NULL;
@ -124,7 +125,7 @@ void *PoolGet(Pool *p) {
void PoolReturn(Pool *p, void *data) { void PoolReturn(Pool *p, void *data) {
PoolBucket *pb = p->empty_list; PoolBucket *pb = p->empty_list;
if (pb == NULL) { if (pb == NULL) {
printf("ERROR: trying to return data to the pool, but no more buckets available."); printf("ERROR: trying to return data %p to the pool %p, but no more buckets available.\n", data, p);
return; return;
} }

Loading…
Cancel
Save