32#ifndef detail_ut_large_page_alloc_osx_h
33#define detail_ut_large_page_alloc_osx_h
35#include <mach/vm_statistics.h>
39#include "mysqld_error.h"
60 void *ptr = mmap(0, n_bytes_rounded, PROT_READ | PROT_WRITE,
64 <<
"large_page_aligned_alloc mmap(" << n_bytes_rounded
69 return (ptr != (
void *)-1) ? ptr :
nullptr;
83 auto ret = munmap(ptr, n_bytes_rounded);
86 <<
"large_page_aligned_free munmap(" << ptr <<
", " << n_bytes_rounded
108 "superpage size is not the one that has been expected (2MB). In case this \
109 is a wanted change, please tweak this static_assert _and_ modify this function \
110 to return appropriate new superpage size value.");
111 return 2 * 1024 * 1024;
const size_t large_page_default_size
System-default huge (large) page setting.
Definition: ut0new.cc:40
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:56
Definition: ut0tuple.h:57
static auto log_warn()
Definition: ut0log.h:451
static auto log_error()
Definition: ut0log.h:452
constexpr size_t pow2_round(size_t n, size_t m)
Calculates the biggest multiple of m that is not bigger than n when m is a power of two.
Definition: helper.h:57
void * large_page_aligned_alloc(size_t n_bytes)
Allocates memory backed by large (huge) pages.
Definition: large_page_alloc-linux.h:52
static constexpr auto SUPER_PAGE_SIZE
Superpage size to be used (2MB).
Definition: large_page_alloc-osx.h:49
bool large_page_aligned_free(void *ptr, size_t n_bytes)
Releases memory backed by large (huge) pages.
Definition: large_page_alloc-linux.h:75
size_t large_page_size()
Queries the current size of large (huge) pages on running system.
Definition: large_page_alloc-linux.h:95
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
Base of InnoDB utilities.