CLEANUP: pools: rename all pool functions and pointers to remove this "2"
During the migration to the second version of the pools, the new
functions and pool pointers were all called "pool_something2()" and
"pool2_something". Now there's no more pool v1 code and it's a real
pain to still have to deal with this. Let's clean this up now by
removing the "2" everywhere, and by renaming the pool heads
"pool_head_something".
diff --git a/src/memory.c b/src/memory.c
index fc1f624..4290c4b 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -123,7 +123,7 @@
if (failed)
return NULL;
failed++;
- pool_gc2(pool);
+ pool_gc(pool);
continue;
}
if (++pool->allocated > avail)
@@ -151,7 +151,7 @@
/*
* This function frees whatever can be freed in pool <pool>.
*/
-void pool_flush2(struct pool_head *pool)
+void pool_flush(struct pool_head *pool)
{
void *temp, *next;
if (!pool)
@@ -175,11 +175,11 @@
* the minimum thresholds imposed by owners. It takes care of avoiding
* recursion because it may be called from a signal handler.
*
- * <pool_ctx> is used when pool_gc2 is called to release resources to allocate
+ * <pool_ctx> is used when pool_gc is called to release resources to allocate
* an element in __pool_refill_alloc. It is important because <pool_ctx> is
* already locked, so we need to skip the lock here.
*/
-void pool_gc2(struct pool_head *pool_ctx)
+void pool_gc(struct pool_head *pool_ctx)
{
static int recurse;
int cur_recurse = 0;
@@ -216,10 +216,10 @@
* pointer, otherwise it returns the pool.
* .
*/
-void *pool_destroy2(struct pool_head *pool)
+void *pool_destroy(struct pool_head *pool)
{
if (pool) {
- pool_flush2(pool);
+ pool_flush(pool);
if (pool->used)
return pool;
pool->users--;