Skip to content

Commit

Permalink
21053: Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
howsohazard committed Jul 26, 2024
1 parent 87f63ec commit e8d094f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
3 changes: 1 addition & 2 deletions src/Amalgam/evaluablenode/EvaluableNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1565,8 +1565,7 @@ void EvaluableNode::DestructValue()
void EvaluableNode::Invalidate()
{
#ifdef AMALGAM_FAST_MEMORY_INTEGRITY
if(IsNodeDeallocated())
assert(false);
assert(!IsNodeDeallocated());
#endif

if(!HasExtendedValue())
Expand Down
7 changes: 2 additions & 5 deletions src/Amalgam/evaluablenode/EvaluableNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,10 @@ class EvaluableNode
static size_t GetEstimatedNodeSizeInBytes(EvaluableNode *n);

//gets current type
constexpr EvaluableNodeType &GetType()
__forceinline EvaluableNodeType &GetType()
{
#ifdef AMALGAM_FAST_MEMORY_INTEGRITY
if(type == ENT_DEALLOCATED)
{
assert(false);
}
assert(type != ENT_DEALLOCATED);
#endif
return type;
}
Expand Down
15 changes: 3 additions & 12 deletions src/Amalgam/evaluablenode/EvaluableNodeManagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ class EvaluableNodeStackStateSaver
originalStackSize = stack->size();

#ifdef AMALGAM_FAST_MEMORY_INTEGRITY
if(initial_element != nullptr && initial_element->IsNodeDeallocated())
{
assert(false);
}
assert(initial_element == nullptr || !initial_element->IsNodeDeallocated());
#endif

stack->push_back(initial_element);
Expand All @@ -222,10 +219,7 @@ class EvaluableNodeStackStateSaver
__forceinline void PushEvaluableNode(EvaluableNode *n)
{
#ifdef AMALGAM_FAST_MEMORY_INTEGRITY
if(n != nullptr && n->IsNodeDeallocated())
{
assert(false);
}
assert(n == nullptr || !n->IsNodeDeallocated());
#endif
stack->push_back(n);
}
Expand All @@ -245,10 +239,7 @@ class EvaluableNodeStackStateSaver
__forceinline void SetStackLocation(size_t location, EvaluableNode *new_value)
{
#ifdef AMALGAM_FAST_MEMORY_INTEGRITY
if(new_value != nullptr && new_value->IsNodeDeallocated())
{
assert(false);
}
assert(new_value == nullptr || !new_value->IsNodeDeallocated());
#endif
(*stack)[location] = new_value;
}
Expand Down

0 comments on commit e8d094f

Please sign in to comment.