diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gc.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -81,14 +81,22 @@ GC::collect(const Roots& roots) Heap::iterator next = i; ++next; - if ((*i)->marked()) { - (*i)->mark(false); - assert(!(*i)->marked()); - } else { - tlsf_free((tlsf_t*)_pool, ((char*)(*i) - sizeof(Object::Header))); - _heap.erase(i); + switch ((*i)->tag()) { + case T_UNKNOWN: + case T_TVAR: + case T_SYMBOL: + i = next; + continue; + default: + if ((*i)->marked()) { + (*i)->mark(false); + assert(!(*i)->marked()); + } else { + tlsf_free((tlsf_t*)_pool, ((char*)(*i) - sizeof(Object::Header))); + _heap.erase(i); + } + i = next; } - i = next; } //std::cerr << "[GC] Collect " << oldSize << " => " << _heap.size() << endl; |