]> git.ipfire.org Git - thirdparty/systemd.git/commit
Turn mempool_enabled() into a weak symbol
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 12 Jun 2022 14:52:57 +0000 (16:52 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 29 Jun 2022 14:51:52 +0000 (16:51 +0200)
commitb01f31954f1c7c4601925173ae2638b572224e9a
tree1eb4c844727641e5f2682539f9f127581b4b82df
parentf63d1b0efa64fe716c2855a0410ac47ad67f7dec
Turn mempool_enabled() into a weak symbol

Before we had the following scheme:
mempool_enabled() would check mempool_use_allowed, and
libsystemd-shared would be linked with a .c file that provides mempool_use_allowed=true,
while other things would linked with a different .c file with mempool_use_allowed=false.

In the new scheme, mempool_enabled() itself is a weak symbol. If it's
not found, we assume false. So it only needs to be provided for libsystemd-shared,
where it can return false or true.

test-set-disable-mempool is libshared, so it gets the symbol. But then we
actually disable the mempool via envvar. mempool_enable() is called to check
its return value directly.
meson.build
src/basic/hashmap.c
src/basic/mempool.c
src/basic/mempool.h
src/libsystemd/disable-mempool.c [deleted file]
src/libsystemd/meson.build
src/shared/enable-mempool.c
src/test/test-set-disable-mempool.c