CLEANUP: pools: rename __pool_free() to pool_put_to_shared_cache()
Now the multi-level cache becomes more visible:
pool_get_from_local_cache()
pool_put_to_local_cache()
pool_get_from_shared_cache()
pool_put_to_shared_cache()
diff --git a/include/haproxy/pool.h b/include/haproxy/pool.h
index c8e5ca5..6f01971 100644
--- a/include/haproxy/pool.h
+++ b/include/haproxy/pool.h
@@ -136,7 +136,7 @@
return NULL;
}
-static inline void __pool_free(struct pool_head *pool, void *ptr)
+static inline void pool_put_to_shared_cache(struct pool_head *pool, void *ptr)
{
_HA_ATOMIC_DEC(&pool->used);
_HA_ATOMIC_DEC(&pool->allocated);
@@ -182,7 +182,7 @@
* Both the pool and the pointer must be valid. Use pool_free() for normal
* operations.
*/
-static inline void __pool_free(struct pool_head *pool, void *ptr)
+static inline void pool_put_to_shared_cache(struct pool_head *pool, void *ptr)
{
void **free_list = pool->free_list;
@@ -234,7 +234,7 @@
/* unconditionally stores the object as-is into the global pool. The object
* must not be NULL. Use pool_free() instead.
*/
-static inline void __pool_free(struct pool_head *pool, void *ptr)
+static inline void pool_put_to_shared_cache(struct pool_head *pool, void *ptr)
{
#ifndef DEBUG_UAF /* normal pool behaviour */
HA_SPIN_LOCK(POOL_LOCK, &pool->lock);
@@ -342,7 +342,7 @@
return;
}
#endif
- __pool_free(pool, ptr);
+ pool_put_to_shared_cache(pool, ptr);
}
}
diff --git a/src/pool.c b/src/pool.c
index d1e48fd..db5d931 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -141,7 +141,7 @@
ph->count--;
pool_cache_count--;
pool_cache_bytes -= pool->size;
- __pool_free(pool, item);
+ pool_put_to_shared_cache(pool, item);
} while (pool_cache_bytes > CONFIG_HAP_POOL_CACHE_SIZE * 7 / 8);
}
#endif