File tree Expand file tree Collapse file tree 4 files changed +24
-11
lines changed
Expand file tree Collapse file tree 4 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 77#include " Checker.hxx"
88#include " AllocatorStats.hxx"
99#include " system/PageAllocator.hxx"
10+ #include " system/PageSize.hxx"
1011#include " system/HugePage.hxx"
1112#include " system/VmaName.hxx"
1213#include " util/DivideRoundUp.hxx"
Original file line number Diff line number Diff line change 44
55#include " LargeAllocation.hxx"
66#include " PageAllocator.hxx"
7+ #include " PageSize.hxx"
78
89#include < new>
910
Original file line number Diff line number Diff line change 1111
1212#include < sys/mman.h>
1313
14- static constexpr std::size_t PAGE_SIZE = 4096 ;
15-
16- /* *
17- * Round up the parameter, make it page-aligned.
18- */
19- static constexpr std::size_t
20- AlignToPageSize (std::size_t size) noexcept
21- {
22- return RoundUpToPowerOfTwo (size, PAGE_SIZE);
23- }
24-
2514/* *
2615 * Allocate pages from the kernel
2716 *
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: BSD-2-Clause
2+ // Copyright CM4all GmbH
3+ // author: Max Kellermann <max.kellermann@ionos.com>
4+
5+ #pragma once
6+
7+ #include " util/RoundPowerOfTwo.hxx"
8+
9+ #include < cstddef>
10+
11+ #include < sys/mman.h>
12+
13+ static constexpr std::size_t PAGE_SIZE = 4096 ;
14+
15+ /* *
16+ * Round up the parameter, make it page-aligned.
17+ */
18+ static constexpr std::size_t
19+ AlignToPageSize (std::size_t size) noexcept
20+ {
21+ return RoundUpToPowerOfTwo (size, PAGE_SIZE);
22+ }
You can’t perform that action at this time.
0 commit comments