summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-06 07:41:05 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-07 07:29:29 (GMT)
commit93cc2eef38eab76831916bfee9d6fe16fbaaf4c1 (patch)
treeac3ec00e240d1ec818908f70be105d30e9b6483e /Source/cmPolicies.h
parent44a8115797cc3f804d653928d71b126b39e29210 (diff)
downloadCMake-93cc2eef38eab76831916bfee9d6fe16fbaaf4c1.zip
CMake-93cc2eef38eab76831916bfee9d6fe16fbaaf4c1.tar.gz
CMake-93cc2eef38eab76831916bfee9d6fe16fbaaf4c1.tar.bz2
cmPolicies: Store all statuses in a single bitset.
Currently there are an optimal number of policies (64) such that there are no wasted bits. When another policy is added, the cmPolicyMap will grow from 40 bytes to 80, and occupy 45. By storing all in a single bitset, we stay under the cache line size of 64 bytes until there are 512 policies in a range.
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r--Source/cmPolicies.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8c72dfe..8a3c27d 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -244,6 +244,7 @@ public:
REQUIRED_IF_USED,
REQUIRED_ALWAYS ///< Issue an error unless user sets policy status to NEW.
};
+#define POLICY_STATUS_COUNT 5
/// Policy identifiers
enum PolicyID
@@ -287,11 +288,7 @@ public:
bool IsEmpty() const;
private:
- std::bitset<cmPolicies::CMPCOUNT> OLD;
- std::bitset<cmPolicies::CMPCOUNT> WARN;
- std::bitset<cmPolicies::CMPCOUNT> NEW;
- std::bitset<cmPolicies::CMPCOUNT> REQUIRED_IF_USED;
- std::bitset<cmPolicies::CMPCOUNT> REQUIRED_ALWAYS;
+ std::bitset<cmPolicies::CMPCOUNT * POLICY_STATUS_COUNT> Status;
};
};