blob: 78449c10004667ec409a545e2a791fa8939e2064 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
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;
}
  |