[poincare] Ghost nodes

This commit is contained in:
Léa Saviot
2018-08-03 11:16:50 +02:00
parent 748291d6b8
commit caa12ec49e
11 changed files with 146 additions and 53 deletions

View File

@@ -1,9 +1,16 @@
#include <poincare/expression_node.h>
#include <poincare/undefined.h>
#include <poincare/ghost_expression_node.h>
#include <poincare/allocation_failed_expression_node.h>
namespace Poincare {
TreeNode * ExpressionNode::GhostStaticNode() {
static GhostExpressionNode GhostNode;
TreePool::sharedPool()->registerStaticNodeIfRequired(&GhostNode);
return &GhostNode;
}
TreeNode * ExpressionNode::FailedAllocationStaticNode() {
static AllocationFailedExpressionNode FailureNode;
TreePool::sharedPool()->registerStaticNodeIfRequired(&FailureNode);