aboutsummaryrefslogtreecommitdiffstats
path: root/gclib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gclib.cpp')
-rw-r--r--gclib.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/gclib.cpp b/gclib.cpp
index 0d2d84e..8c9f140 100644
--- a/gclib.cpp
+++ b/gclib.cpp
@@ -22,21 +22,15 @@
extern "C" {
-static const size_t COLLECT_SIZE = 8 * 1024 * 1024; // 8 MiB
-
-void
-tuplr_gc_collect()
-{
- Object::pool.collect(Object::pool.roots());
-}
-
void*
tuplr_gc_allocate(unsigned size, uint8_t tag)
{
+ static const size_t COLLECT_SIZE = 8 * 1024 * 1024; // 8 MiB
+
static size_t allocated = 0;
allocated += size;
if (allocated > COLLECT_SIZE) {
- tuplr_gc_collect();
+ Object::pool.collect(Object::pool.roots());
allocated = 0;
}