diff options
Diffstat (limited to 'gclib.cpp')
-rw-r--r-- | gclib.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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; } |