aboutsummaryrefslogtreecommitdiffstats
path: root/src/gc.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-03 03:08:08 +0000
committerDavid Robillard <d@drobilla.net>2010-12-03 03:08:08 +0000
commitad056bdf71c8bf780e22f983c83fac0e3a2f41f3 (patch)
tree0d70ea6eb4188f40034e8e011adc5be6e0956fc7 /src/gc.cpp
parent074edbce57e850fc3293eef47861e0ed7707c7e9 (diff)
downloadresp-ad056bdf71c8bf780e22f983c83fac0e3a2f41f3.tar.gz
resp-ad056bdf71c8bf780e22f983c83fac0e3a2f41f3.tar.bz2
resp-ad056bdf71c8bf780e22f983c83fac0e3a2f41f3.zip
Remove use of RTTI for AST.
git-svn-id: http://svn.drobilla.net/resp/resp@290 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/gc.cpp')
-rw-r--r--src/gc.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gc.cpp b/src/gc.cpp
index 8ed0fb2..cff4f0a 100644
--- a/src/gc.cpp
+++ b/src/gc.cpp
@@ -57,7 +57,7 @@ mark(const Object* obj)
obj->mark(true);
if (obj->tag() != T_UNKNOWN) {
- const ATuple* tup = ((const AST*)obj)->to<const ATuple*>();
+ const ATuple* tup = ((const AST*)obj)->to_tuple();
if (tup)
FOREACHP(ATuple::const_iterator, i, tup)
mark(*i);
@@ -80,8 +80,9 @@ GC::collect(const Roots& roots)
(*i)->mark(false);
assert(!(*i)->marked());
} else {
- if ((*i)->tag() != T_UNKNOWN)
- ((AST*)*i)->~AST();
+ const Tag tag = (*i)->tag();
+ if (tag == T_TUPLE || tag == T_TYPE)
+ free(((ATuple*)*i)->_vec);
tlsf_free((tlsf_t*)_pool, ((char*)(*i) - sizeof(Object::Header)));
_heap.erase(i);