Skip to content

Move config manager singleton to namespace#4653

Merged
ranisalt merged 1 commit intootland:masterfrom
ranisalt:configmanager-namespace
Apr 27, 2024
Merged

Move config manager singleton to namespace#4653
ranisalt merged 1 commit intootland:masterfrom
ranisalt:configmanager-namespace

Conversation

@ranisalt
Copy link
Member

Pull Request Prelude

Changes Proposed

Using a namespace rather than a singleton/global has two major advantages:

  • it avoids accidentally creating a new instance (which can be fixed with private constructor + getInstance static method, but this is verbose)
  • it does not generate RTTI for the class

It also reduces the size of the header by hiding what would be private in an anonymous namespace, and gives better opportunity to optimize it (no external interface to respect = compiler can go nuts)

Issues addressed:

@ranisalt ranisalt force-pushed the configmanager-namespace branch from 9d315a4 to f7d7590 Compare April 20, 2024 14:50
@ghost ghost requested review from DSpeichert, EvilHero90 and MillhioreBT April 21, 2024 03:59
@ranisalt ranisalt force-pushed the configmanager-namespace branch from f7d7590 to d6ff4b7 Compare April 23, 2024 01:03
@ranisalt ranisalt force-pushed the configmanager-namespace branch from d6ff4b7 to 87b46ef Compare April 27, 2024 03:18
@ranisalt ranisalt merged commit 73032fa into otland:master Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant