HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

src/shared/enable-mempool.c

Git blob: 1529959922aad10389ab1daa8b2bd8cf0b52d903

Lines 1–18 of 18

/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
#include "env-util.h"
#include "mempool.h"
#include "process-util.h"
 
bool mempool_enabled(void) {
        static int cache = -1;
 
        if (!is_main_thread())
                return false;
 
        if (cache < 0)
                cache = getenv_bool("SYSTEMD_MEMPOOL") != 0;
 
        return cache;
}