Moved Heap::the for safe compilation

This commit is contained in:
Victor Olin 2023-03-23 13:09:50 +01:00
parent 501f319834
commit 7ea2e2733f
2 changed files with 13 additions and 14 deletions

View file

@ -14,7 +14,18 @@ using std::cout, std::endl, std::vector, std::hex, std::dec;
namespace GC
{
/**
* This implementation of the() guarantees laziness
* on the instance and a correct destruction with
* the destructor.
*
* @returns The singleton object.
*/
Heap& Heap::the()
{
static Heap instance;
return instance;
}
/**
* Initialises the heap singleton and saves the address