File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ namespace llvm {
39
39
// / while iterating, therefore materialising them and losing the gains in terms
40
40
// / of memory usage this container provides. If you have such a use case, you
41
41
// / probably want to use a normal std::vector or a llvm::SmallVector.
42
- template <typename T, size_t PageSize = 1024 / sizeof (T)> class PagedVector {
42
+ template <typename T, size_t PageSize = PowerOf2Ceil(1024 / sizeof (T))>
43
+ class PagedVector {
43
44
static_assert (PageSize > 1 , " PageSize must be greater than 0. Most likely "
44
45
" you want it to be greater than 16." );
45
46
// / The actual number of elements in the vector which can be accessed.
Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ constexpr inline uint64_t NextPowerOf2(uint64_t A) {
358
358
359
359
// / Returns the power of two which is greater than or equal to the given value.
360
360
// / Essentially, it is a ceil operation across the domain of powers of two.
361
- inline uint64_t PowerOf2Ceil (uint64_t A) {
361
+ constexpr inline uint64_t PowerOf2Ceil (uint64_t A) {
362
362
if (!A)
363
363
return 0 ;
364
364
return NextPowerOf2 (A - 1 );
You can’t perform that action at this time.
0 commit comments