src/shared/enable-mempool.c
raw| 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 | |
| 3 | #include "env-util.h" |
| 4 | #include "mempool.h" |
| 5 | #include "process-util.h" |
| 6 | |
| 7 | bool mempool_enabled(void) { |
| 8 | static int cache = -1; |
| 9 | |
| 10 | if (!is_main_thread()) |
| 11 | return false; |
| 12 | |
| 13 | if (cache < 0) |
| 14 | cache = getenv_bool("SYSTEMD_MEMPOOL") != 0; |
| 15 | |
| 16 | return cache; |
| 17 | } |