BUG/MINOR: shctx: do not look for available blocks when the first one is enough
authorWilly Tarreau <w@1wt.eu>
Fri, 19 Nov 2021 16:42:49 +0000 (17:42 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 23 Nov 2021 15:34:07 +0000 (16:34 +0100)
commitc4d5835a017a30910d8ab0b8453843b4e0263b6e
treedcc713b87a13751e17b12597c0aac59f2815cb6d
parenta148a38a82e7e823073231de1f82825c7af088cc
BUG/MINOR: shctx: do not look for available blocks when the first one is enough

In shctx_row_reserve_hot() we only leave if we've found the exact
requested size instead of at least as large, as is documented. This
results in extra lookups and free calls in the avail loop while it is
not needed, and participates to seeing a negative data_len early as
spotted in previous bugs.

It doesn't seem to have any other impact however, but it's better to
backport it to stable branches.

(cherry picked from commit cafe15c743f6bc1a9e624939e1851f215645e4f2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 4c98c072ff0a7c0dc7778264d838a99b36369fd9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/shctx.c