Browse Source

core: Make System's default constructor private

This makes it a compilation error to construct additional instances of
the System class directly, preventing accidental wasteful constructions
over and over.
nce_cpp
Lioncash 8 years ago
parent
commit
74185c108e
  1. 2
      src/core/core.cpp
  2. 2
      src/core/core.h

2
src/core/core.cpp

@ -25,6 +25,8 @@ namespace Core {
/*static*/ System System::s_instance; /*static*/ System System::s_instance;
System::System() = default;
System::~System() = default; System::~System() = default;
/// Runs a CPU core while the system is powered on /// Runs a CPU core while the system is powered on

2
src/core/core.h

@ -168,6 +168,8 @@ public:
} }
private: private:
System();
/// Returns the currently running CPU core /// Returns the currently running CPU core
Cpu& CurrentCpuCore(); Cpu& CurrentCpuCore();

Loading…
Cancel
Save