]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pools: factor the release code into pool_put_to_os()
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Apr 2021 15:48:40 +0000 (17:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Apr 2021 13:24:33 +0000 (15:24 +0200)
commit45e4e28161ea183634136ab8269dd57a52b7ea0c
tree340153baef5d1c22e637c00cdaf2e9efd8da705d
parentacf0c5449157a4d6d8cc43e753fc59479414432a
MINOR: pools: factor the release code into pool_put_to_os()

There are two levels of freeing to the OS:
  - code that wants to keep the pool's usage counters updated uses
    pool_free_area() and handles the counters itself. That's what
    pool_put_to_shared_cache() does in the no-global-pools case.
  - code that does not want to update the counters because they were
    already updated only calls pool_free_area().

Let's extract these calls to establish the symmetry with pool_get_from_os()
and pool_alloc_nocache(), resulting in pool_put_to_os() (which only updates
the allocated counter) and pool_free_nocache() (which also updates the used
counter). This will later allow to simplify the generic code.
include/haproxy/pool.h
src/pool.c