diff options
-rw-r--r-- | include/llvm/ADT/IntervalMap.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/ADT/IntervalMap.h b/include/llvm/ADT/IntervalMap.h index f54a0abf6c..8606a178b7 100644 --- a/include/llvm/ADT/IntervalMap.h +++ b/include/llvm/ADT/IntervalMap.h @@ -327,12 +327,15 @@ struct NodeSizer { DesiredLeafSize = DesiredNodeBytes / static_cast<unsigned>(2*sizeof(KeyT)+sizeof(ValT)), MinLeafSize = 3, - LeafSize = DesiredLeafSize > MinLeafSize ? DesiredLeafSize : MinLeafSize, + LeafSize = DesiredLeafSize > MinLeafSize ? DesiredLeafSize : MinLeafSize + }; + + typedef NodeBase<std::pair<KeyT, KeyT>, ValT, LeafSize> LeafBase; + enum { // Now that we have the leaf branching factor, compute the actual allocation // unit size by rounding up to a whole number of cache lines. - LeafBytes = sizeof(NodeBase<std::pair<KeyT, KeyT>, ValT, LeafSize>), - AllocBytes = (LeafBytes + CacheLineBytes-1) & ~(CacheLineBytes-1), + AllocBytes = (sizeof(LeafBase) + CacheLineBytes-1) & ~(CacheLineBytes-1), // Determine the branching factor for branch nodes. BranchSize = AllocBytes / |