]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: memory: cut pool allocator in 3 layers
authorWilly Tarreau <w@1wt.eu>
Mon, 8 Dec 2014 15:35:23 +0000 (16:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:31 +0000 (23:47 +0100)
commit0262241e265fc615047e9156c65f805814357280
tree8466aa0bd974f396cc1893289938ae83767ee60f
parente430e77dfd151e5d9aa760d98033455b16abe53a
MINOR: memory: cut pool allocator in 3 layers

pool_alloc2() used to pick the entry from the pool, fall back to
pool_refill_alloc(), and to perform the poisonning itself, which
pool_refill_alloc() was also doing. While this led to optimal
code size, it imposes memory poisonning on the buffers as well,
which is extremely slow on large buffers.

This patch cuts the allocator in 3 layers :
  - a layer to pick the first entry from the pool without falling back to
    pool_refill_alloc() : pool_get_first()
  - a layer to allocate a dirty area by falling back to pool_refill_alloc()
    but never performing the poisonning : pool_alloc_dirty()
  - pool_alloc2() which calls the latter and optionally poisons the area

No functional changes were made.
include/common/memory.h
src/memory.c