mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 13:50:28 +01:00
[poincare] Register Static Allocation Failure if required
This commit is contained in:
@@ -11,6 +11,7 @@ namespace Poincare {
|
||||
|
||||
AdditionNode * AdditionNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<AdditionNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Poincare {
|
||||
|
||||
CharLayoutNode * CharLayoutNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureLayoutNode<CharLayoutNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ void DecimalNode::setValue(native_uint_t * mantissaDigits, size_t mantissaSize,
|
||||
|
||||
DecimalNode * DecimalNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureDecimalNode failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@ extern "C" {
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
DivisionNode * FailedAllocationStaticNode() {
|
||||
DivisionNode * DivisionNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<DivisionNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Poincare {
|
||||
|
||||
template<typename T> FloatNode<T> * FloatNode<T>::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<FloatNode<T>> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ static inline KDCoordinate max(KDCoordinate x, KDCoordinate y) { return x > y ?
|
||||
|
||||
FractionLayoutNode * FractionLayoutNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureLayoutNode<FractionLayoutNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace Poincare {
|
||||
|
||||
GhostNode * GhostNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailedGhostNode FailureNode;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&FailureNode);
|
||||
return &FailureNode;
|
||||
static AllocationFailedGhostNode failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ static inline KDCoordinate maxCoordinate(KDCoordinate c1, KDCoordinate c2) { ret
|
||||
|
||||
HorizontalLayoutNode * HorizontalLayoutNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureLayoutNode<HorizontalLayoutNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Poincare {
|
||||
|
||||
InfinityNode * InfinityNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<InfinityNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -355,6 +355,7 @@ NaturalIntegerPointer::NaturalIntegerPointer(native_uint_t * buffer, size_t size
|
||||
|
||||
IntegerNode * IntegerNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureIntegerNode failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ void LayoutNode::invalidAllSizesPositionsAndBaselines() {
|
||||
// TreeNode
|
||||
|
||||
TreeNode * LayoutNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailedLayoutNode FailureNode;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&FailureNode);
|
||||
return &FailureNode;
|
||||
static AllocationFailedLayoutNode failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
// Tree navigation
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Poincare {
|
||||
template<typename T>
|
||||
MatrixComplexNode<T> * MatrixComplexNode<T>::FailedAllocationStaticNode() {
|
||||
static AllocationFailureMatrixComplexNode<T> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace Poincare {
|
||||
|
||||
MultiplicationNode * MultiplicationNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<MultiplicationNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Poincare {
|
||||
|
||||
OppositeNode * OppositeNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<OppositeNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Poincare {
|
||||
|
||||
ParenthesisNode * ParenthesisNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<ParenthesisNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Poincare {
|
||||
|
||||
PowerNode * PowerNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<PowerNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ void RationalNode::setDigits(native_uint_t * numeratorDigits, size_t numeratorSi
|
||||
|
||||
RationalNode * RationalNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureRationalNode failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Poincare {
|
||||
|
||||
SubtractionNode * SubtractionNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<SubtractionNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Poincare {
|
||||
|
||||
SymbolNode * SymbolNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<SymbolNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Poincare {
|
||||
|
||||
UndefinedNode * UndefinedNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureExpressionNode<UndefinedNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Poincare {
|
||||
|
||||
VerticalOffsetLayoutNode * VerticalOffsetLayoutNode::FailedAllocationStaticNode() {
|
||||
static AllocationFailureLayoutNode<VerticalOffsetLayoutNode> failure;
|
||||
TreePool::sharedPool()->registerStaticNodeIfRequired(&failure);
|
||||
return &failure;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user