]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: pools: remove the unused pool_get_first() function
authorWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 13:56:30 +0000 (14:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 15:28:08 +0000 (16:28 +0100)
This one used to maintain a shortcut in the pools allocation path that
was only justified by b_alloc_fast() which was not used! Let's get rid
of it as well so that the allocator becomes a bit more straight forward.

include/haproxy/pool.h

index 8f315531525d0e043daf1cf8b7c6a8b0283ff4b6..abaa087e73a1c2c63d396d8a404ed5aa31328372 100644 (file)
@@ -283,24 +283,6 @@ static inline void __pool_free(struct pool_head *pool, void *ptr)
 
 /****************** Common high-level code ******************/
 
-static inline void *pool_get_first(struct pool_head *pool)
-{
-       void *p;
-
-#ifdef CONFIG_HAP_LOCAL_POOLS
-       if (likely(p = __pool_get_from_cache(pool)))
-               return p;
-#endif
-
-#if !defined(CONFIG_HAP_LOCKLESS_POOLS) && !defined(CONFIG_HAP_NO_GLOBAL_POOLS)
-       HA_SPIN_LOCK(POOL_LOCK, &pool->lock);
-#endif
-       p = __pool_get_first(pool);
-#if !defined(CONFIG_HAP_LOCKLESS_POOLS) && !defined(CONFIG_HAP_NO_GLOBAL_POOLS)
-       HA_SPIN_UNLOCK(POOL_LOCK, &pool->lock);
-#endif
-       return p;
-}
 /*
  * Returns a pointer to type <type> taken from the pool <pool_type> or
  * dynamically allocated. In the first case, <pool_type> is updated to point to