Cache const/non-const variants of Atomic and ReferenceTypes.

More reduction of dynamic memory allocation.
This commit is contained in:
Matt Pharr
2012-05-04 13:14:44 -07:00
parent c0019bd8e5
commit bff02017da
2 changed files with 27 additions and 4 deletions

3
type.h
View File

@@ -332,6 +332,8 @@ private:
const Variability variability;
const bool isConst;
AtomicType(BasicType basicType, Variability v, bool isConst);
mutable const AtomicType *asOtherConstType;
};
@@ -802,6 +804,7 @@ public:
private:
const Type * const targetType;
mutable const ReferenceType *asOtherConstType;
};