perf(kernel/expr): use thread local deletion buffer

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-16 08:39:03 +01:00
parent a748e8f858
commit aae40f07e2

View file

@ -292,9 +292,12 @@ expr mk_binding(expr_kind k, name const & n, expr const & t, expr const & e, bin
expr mk_sort(level const & l) { return cache(expr(new expr_sort(l))); }
// =======================================
typedef buffer<expr_cell*> del_buffer;
MK_THREAD_LOCAL_GET_DEF(del_buffer, get_dealloc_buffer)
void expr_cell::dealloc() {
try {
buffer<expr_cell*> todo;
del_buffer & todo = get_dealloc_buffer();
todo.push_back(this);
while (!todo.empty()) {
expr_cell * it = todo.back();