Merge branch 'g-collection' of https://github.com/bachelor-group-66-systemf/language into g-collection
This commit is contained in:
commit
fb4cd8eb9b
2 changed files with 13 additions and 14 deletions
|
|
@ -79,19 +79,7 @@ namespace GC
|
||||||
* saved as the limit for scanning the stack in collect.
|
* saved as the limit for scanning the stack in collect.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
static Heap &the();
|
||||||
* This implementation of the() guarantees laziness
|
|
||||||
* on the instance and a correct destruction with
|
|
||||||
* the destructor.
|
|
||||||
*
|
|
||||||
* @returns The singleton object.
|
|
||||||
*/
|
|
||||||
static Heap& the()
|
|
||||||
{
|
|
||||||
static Heap instance;
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void init();
|
static void init();
|
||||||
static void dispose();
|
static void dispose();
|
||||||
static void *alloc(size_t size);
|
static void *alloc(size_t size);
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,18 @@ using std::cout, std::endl, std::vector, std::hex, std::dec;
|
||||||
|
|
||||||
namespace GC
|
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
|
* Initialises the heap singleton and saves the address
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue