]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: memory: Set objects size for pools in the per-thread cache
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 25 Jun 2019 19:45:59 +0000 (21:45 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 26 Jun 2019 07:57:49 +0000 (09:57 +0200)
commit2f6d3c0d65f09c342612d1b69198e23773fb7520
treed57f2dc05ac55b4f461c0baec0c9b1b261f7f56a
parentc2518a53aed70b373edc5c169cc3a02ed2398bba
BUG/MINOR: memory: Set objects size for pools in the per-thread cache

When a memory pool is created, it may be allocated from a static array. This
happens for "most common" pools, allocated first. Objects of these pools may
also be cached in a pool cache. Of course, to not cache too much entries, we
track the number of cached objects and the total size of the cache.

But the objects size of each pool in the cache (ie, pool_cache[tid][idx].size,
where tid is the thread-id and idx is the index of the pool) was never set. So
the total size of the cache was never limited. Now when a pool is created, if
these objects may be cached, we set the corresponding objects size in the pool
cache.

This patch must be backported to 2.0 and 1.9.
src/memory.c