MINOR: pools: prepare functions to override malloc/free in pools
This will be useful to add some debugging capabilities. For now it
changes nothing.
diff --git a/src/memory.c b/src/memory.c
index b0b32e7..fc1f624 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -117,7 +117,7 @@
if (pool->limit && pool->allocated >= pool->limit)
return NULL;
- ptr = malloc(pool->size + POOL_EXTRA);
+ ptr = pool_alloc_area(pool->size + POOL_EXTRA);
if (!ptr) {
pool->failed++;
if (failed)
@@ -163,7 +163,7 @@
temp = next;
next = *POOL_LINK(pool, temp);
pool->allocated--;
- free(temp);
+ pool_free_area(temp, pool->size + POOL_EXTRA);
}
pool->free_list = next;
HA_SPIN_UNLOCK(POOL_LOCK, &pool->lock);
@@ -199,7 +199,7 @@
temp = next;
next = *POOL_LINK(entry, temp);
entry->allocated--;
- free(temp);
+ pool_free_area(temp, entry->size + POOL_EXTRA);
}
entry->free_list = next;
if (entry != pool_ctx)