mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
chore: change Namespaces to be a global pointer (#4032)
* chore: change Namespaces to be a global pointer Before the namespaces object was defined globally. However it has non-trivial d'tor that is being called after main exits. It's quite dangerous to have global non-POD objects being defined globally. For example, if we used LOG(INFO) inside the Clear function , that would crash dragonfly on exit. Ths PR changes it to be a global pointer. --------- Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
9366c67464
commit
be96e6cf99
22 changed files with 76 additions and 71 deletions
|
@ -49,6 +49,7 @@ class Transaction;
|
|||
class EngineShard;
|
||||
class ConnectionState;
|
||||
class Interpreter;
|
||||
class Namespaces;
|
||||
|
||||
struct LockTagOptions {
|
||||
bool enabled = false;
|
||||
|
@ -132,6 +133,8 @@ extern std::atomic_uint64_t rss_mem_peak;
|
|||
|
||||
extern size_t max_memory_limit;
|
||||
|
||||
extern Namespaces* namespaces;
|
||||
|
||||
// version 5.11 maps to 511 etc.
|
||||
// set upon server start.
|
||||
extern unsigned kernel_version;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue