diff options
author | somov <[email protected]> | 2022-02-10 16:45:49 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:49 +0300 |
commit | 7489e4682331202b9c7d863c0898eb83d7b12c2b (patch) | |
tree | 9142afc54d335ea52910662635b898e79e192e49 /contrib/libs/jemalloc/reg_zone.cpp | |
parent | a5950576e397b1909261050b8c7da16db58f10b1 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/jemalloc/reg_zone.cpp')
-rw-r--r-- | contrib/libs/jemalloc/reg_zone.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/libs/jemalloc/reg_zone.cpp b/contrib/libs/jemalloc/reg_zone.cpp index 8503cd48f74..6a7b9d69e1f 100644 --- a/contrib/libs/jemalloc/reg_zone.cpp +++ b/contrib/libs/jemalloc/reg_zone.cpp @@ -1,33 +1,33 @@ -#include <util/system/compiler.h> - +#include <util/system/compiler.h> + extern "C" void je_zone_register(); -static volatile bool initialized = false; - +static volatile bool initialized = false; + namespace { - struct TInit { + struct TInit { inline TInit() { - if (!initialized) { + if (!initialized) { je_zone_register(); - initialized = true; - } + initialized = true; + } } - }; - + }; + void zone_register() { - static TInit init; - } + static TInit init; + } } - -extern "C" { + +extern "C" { void je_assure_zone_register() { - if (Y_LIKELY(initialized)) { - return; - } - - // Even if we have read false "initialized", real init will be syncronized once by - // Meyers singleton in <anonymous>::register_zone(). We could do a few - // redundant "initialized" and singleton creation checks, but no more than that. + if (Y_LIKELY(initialized)) { + return; + } + + // Even if we have read false "initialized", real init will be syncronized once by + // Meyers singleton in <anonymous>::register_zone(). We could do a few + // redundant "initialized" and singleton creation checks, but no more than that. zone_register(); - } -} + } +} |