aboutsummaryrefslogtreecommitdiffstats
path: root/src/tuplr_gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tuplr_gc.cpp')
-rw-r--r--src/tuplr_gc.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tuplr_gc.cpp b/src/tuplr_gc.cpp
index d999e44..7bd35a4 100644
--- a/src/tuplr_gc.cpp
+++ b/src/tuplr_gc.cpp
@@ -27,7 +27,7 @@
extern "C" {
void*
-tuplr_gc_allocate(unsigned size, uint8_t tag)
+tuplr_gc_allocate(unsigned size)
{
static const size_t COLLECT_SIZE = 8 * 1024 * 1024; // 8 MiB
@@ -38,7 +38,11 @@ tuplr_gc_allocate(unsigned size, uint8_t tag)
allocated = 0;
}
- return Object::pool.alloc(size);
+ void* mem = Object::pool.alloc(size);
+ Object* obj = new (mem) Object();
+ obj->tag(Object::OBJECT);
+
+ return mem;
}
}