Wrapper for GC finished, untested
This commit is contained in:
parent
4f0f8ffef8
commit
07bb53930b
4 changed files with 209 additions and 14 deletions
|
|
@ -1,25 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "heap.hpp"
|
||||
#include "cheap.h"
|
||||
|
||||
struct cheap {
|
||||
struct cheap
|
||||
{
|
||||
void *obj;
|
||||
};
|
||||
|
||||
cheap_t *cheap_the() {
|
||||
cheap_t *cheap_the()
|
||||
{
|
||||
cheap_t *c;
|
||||
GC::Heap *heap;
|
||||
|
||||
c = (cheap_t *)malloc(sizeof(*c));
|
||||
c = static_cast<cheap_t *>(malloc(sizeof(cheap_t)));
|
||||
heap = &GC::Heap::the();
|
||||
c->obj = heap;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
void cheap_init() {
|
||||
void cheap_init()
|
||||
{
|
||||
GC::Heap::init();
|
||||
}
|
||||
|
||||
void cheap_dispose()
|
||||
{
|
||||
GC::Heap::dispose();
|
||||
}
|
||||
|
||||
void *cheap_alloc(unsigned long size)
|
||||
{
|
||||
return GC::Heap::alloc(size);
|
||||
}
|
||||
|
||||
void cheap_set_profiler(cheap_t *cheap, bool mode)
|
||||
{
|
||||
GC::Heap *heap = static_cast<GC::Heap *>(cheap->obj);
|
||||
|
||||
heap->set_profiler(mode);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue