One tree pool instance

This commit is contained in:
Léa Saviot
2018-06-21 10:27:33 +02:00
parent 8ed138fafe
commit f39f974b76
8 changed files with 25 additions and 38 deletions

View File

@@ -2,11 +2,6 @@
#include "tree_pool.h"
#include "expression_node.h"
TreePool * TreeNode::Pool() {
static TreePool pool;
return &pool;
}
void TreeNode::release() {
printf("Releasing of %d(%p)\n", m_identifier, this);
m_referenceCounter--;
@@ -28,6 +23,6 @@ void TreeNode::release() {
printf("DELETE %d(%p)\n", m_identifier, this);
int identifier = m_identifier;
delete this;
Pool()->freeIdentifier(identifier);
TreePool::sharedPool()->freeIdentifier(identifier);
}
}