diff options
Diffstat (limited to 'src/basic/hashmap.c')
-rw-r--r-- | src/basic/hashmap.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index d89bd83c8..2bee671da 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -6,7 +6,6 @@ #include <string.h> #include "alloc-util.h" -//#include "env-util.h" #include "fileio.h" //#include "hashmap.h" #include "macro.h" @@ -767,24 +766,12 @@ static void reset_direct_storage(HashmapBase *h) { memset(p, DIB_RAW_INIT, sizeof(dib_raw_t) * hi->n_direct_buckets); } -static bool use_pool(void) { - static int b = -1; - - if (!is_main_thread()) - return false; - - if (b < 0) - b = getenv_bool("SYSTEMD_MEMPOOL") != 0; - - return b; -} - static struct HashmapBase *hashmap_base_new(const struct hash_ops *hash_ops, enum HashmapType type HASHMAP_DEBUG_PARAMS) { HashmapBase *h; const struct hashmap_type_info *hi = &hashmap_type_info[type]; bool up; - up = use_pool(); + up = mempool_enabled(); h = up ? mempool_alloc0_tile(hi->mempool) : malloc0(hi->head_size); if (!h) |