mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-28 03:25:27 +03:00
memory-util: Add PAGE_ALIGN_DOWN
For example, cgroup v2 rounds down to the previous page when returning memory limits.
This commit is contained in:
parent
86e94d95d0
commit
3a6da69a93
@ -11,6 +11,7 @@
|
||||
|
||||
size_t page_size(void) _pure_;
|
||||
#define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
|
||||
#define PAGE_ALIGN_DOWN(l) (l & ~(page_size() - 1))
|
||||
|
||||
/* Normal memcpy requires src to be nonnull. We do nothing if n is 0. */
|
||||
static inline void memcpy_safe(void *dst, const void *src, size_t n) {
|
||||
|
Loading…
Reference in New Issue
Block a user