reorganize pages.h header

This commit is contained in:
Daniel Micay 2022-01-16 16:57:22 -05:00
parent 3e312695e1
commit 422ee78b3e

View File

@ -12,14 +12,14 @@
#define PAGE_SIZE ((size_t)1 << PAGE_SHIFT) #define PAGE_SIZE ((size_t)1 << PAGE_SHIFT)
#endif #endif
static inline size_t page_align(size_t size) {
return align(size, PAGE_SIZE);
}
void *allocate_pages(size_t usable_size, size_t guard_size, bool unprotect, const char *name); void *allocate_pages(size_t usable_size, size_t guard_size, bool unprotect, const char *name);
void *allocate_pages_aligned(size_t usable_size, size_t alignment, size_t guard_size, const char *name); void *allocate_pages_aligned(size_t usable_size, size_t alignment, size_t guard_size, const char *name);
void deallocate_pages(void *usable, size_t usable_size, size_t guard_size); void deallocate_pages(void *usable, size_t usable_size, size_t guard_size);
static inline size_t page_align(size_t size) {
return align(size, PAGE_SIZE);
}
static inline size_t hash_page(const void *p) { static inline size_t hash_page(const void *p) {
uintptr_t u = (uintptr_t)p >> PAGE_SHIFT; uintptr_t u = (uintptr_t)p >> PAGE_SHIFT;
size_t sum = u; size_t sum = u;