aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/balloc/setup/enable.h
diff options
context:
space:
mode:
authorudovichenko-r <udovichenko-r@yandex-team.ru>2022-07-04 14:16:38 +0300
committerudovichenko-r <udovichenko-r@yandex-team.ru>2022-07-04 14:16:38 +0300
commit5fe1c2b2d90b4ddbd7d1683191a48851363cf53d (patch)
treec413b43fb69611ff1185ead7813a8e0973dca3dc /library/cpp/balloc/setup/enable.h
parentf9651ab5ad67347bf06d6d0789b5d6eb31a7b2cc (diff)
downloadydb-5fe1c2b2d90b4ddbd7d1683191a48851363cf53d.tar.gz
[KIKIMR-15108] Add perf programs to build
ref:8f081efde09627da76e52231d32a83e34b78c1e4
Diffstat (limited to 'library/cpp/balloc/setup/enable.h')
-rw-r--r--library/cpp/balloc/setup/enable.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/cpp/balloc/setup/enable.h b/library/cpp/balloc/setup/enable.h
new file mode 100644
index 0000000000..78449c1000
--- /dev/null
+++ b/library/cpp/balloc/setup/enable.h
@@ -0,0 +1,11 @@
+#pragma once
+
+namespace NAllocSetup {
+ // The IsEnabledByDefault variable should always have static initialization. It is safe to use it in initialization
+ // of global and thread-local objects because standard guarantees that static initalization always takes place
+ // before dynamic initialization:
+ // * C++11 3.6.2.2: "Static initialization shall be performed before any dynamic initialization takes place."
+ // * C++17 6.6.2.2: "All static initialization strongly happens before any dynamic initialization."
+ // On practice a constant value is just baked into the executable during the linking.
+ extern const bool EnableByDefault;
+}