aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/balloc/optional/operators.h
blob: 6107d28a6e3471a2d38376b23940f2519cde457a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <library/cpp/malloc/api/malloc.h>
#include <util/string/type.h>

inline bool BallocEnabled() {
    return !::NMalloc::MallocInfo().CheckParam("disable", true);
}

inline void ThreadDisableBalloc() {
    ::NMalloc::MallocInfo().SetParam("disable", "true");
}

inline void ThreadEnableBalloc() {
    ::NMalloc::MallocInfo().SetParam("disable", "false");
}