Skip to content

Commit

Permalink
Improve Node memory consumption.
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Jun 5, 2020
1 parent 5a6ec09 commit 2435945
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/dsql/ExprNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ UCHAR getFType(const dsc& desc)

enum Scaling { SCALE_MIN, SCALE_SUM };

unsigned setDecDesc(dsc* desc, const dsc& desc1, const dsc& desc2, Scaling sc, SCHAR* nodScale = nullptr)
USHORT setDecDesc(dsc* desc, const dsc& desc1, const dsc& desc2, Scaling sc, SCHAR* nodScale = nullptr)
{
UCHAR zipType = decimalDescTable[getFType(desc1)][getFType(desc2)];
fb_assert(zipType <= DSC_ZTYPE_FIXED);
Expand Down
28 changes: 14 additions & 14 deletions src/dsql/Nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class NodeRefsHolder : public Firebird::PermanentStorage
class ExprNode : public DmlNode
{
public:
enum Type
enum Type : UCHAR
{
// Value types
TYPE_AGGREGATE,
Expand Down Expand Up @@ -509,25 +509,25 @@ class ExprNode : public DmlNode
};

// Generic flags.
static const unsigned FLAG_INVARIANT = 0x01; // Node is recognized as being invariant.
static const USHORT FLAG_INVARIANT = 0x01; // Node is recognized as being invariant.

// Boolean flags.
static const unsigned FLAG_DEOPTIMIZE = 0x02; // Boolean which requires deoptimization.
static const unsigned FLAG_RESIDUAL = 0x04; // Boolean which must remain residual.
static const unsigned FLAG_ANSI_NOT = 0x08; // ANY/ALL predicate is prefixed with a NOT one.
static const USHORT FLAG_DEOPTIMIZE = 0x02; // Boolean which requires deoptimization.
static const USHORT FLAG_RESIDUAL = 0x04; // Boolean which must remain residual.
static const USHORT FLAG_ANSI_NOT = 0x08; // ANY/ALL predicate is prefixed with a NOT one.

// Value flags.
static const unsigned FLAG_DOUBLE = 0x10;
static const unsigned FLAG_DATE = 0x20;
static const unsigned FLAG_DECFLOAT = 0x40;
static const unsigned FLAG_VALUE = 0x80; // Full value area required in impure space.
static const unsigned FLAG_INT128 = 0x100;
static const USHORT FLAG_DOUBLE = 0x10;
static const USHORT FLAG_DATE = 0x20;
static const USHORT FLAG_DECFLOAT = 0x40;
static const USHORT FLAG_VALUE = 0x80; // Full value area required in impure space.
static const USHORT FLAG_INT128 = 0x100;

explicit ExprNode(Type aType, MemoryPool& pool)
: DmlNode(pool),
type(aType),
impureOffset(0),
nodFlags(0),
impureOffset(0)
type(aType)
{
}

Expand Down Expand Up @@ -681,9 +681,9 @@ class ExprNode : public DmlNode
virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const = 0;

public:
const Type type;
unsigned nodFlags;
ULONG impureOffset;
USHORT nodFlags;
const Type type;
};


Expand Down

0 comments on commit 2435945

Please sign in to comment.