31#ifndef detail_ut_large_page_alloc_osx_h
32#define detail_ut_large_page_alloc_osx_h
34#include <mach/vm_statistics.h>
38#include "mysqld_error.h"
59 void *ptr = mmap(
nullptr, n_bytes_rounded, PROT_READ | PROT_WRITE,
63 <<
"large_page_aligned_alloc mmap(" << n_bytes_rounded
68 return (ptr != (
void *)-1) ? ptr :
nullptr;
82 auto ret = munmap(ptr, n_bytes_rounded);
85 <<
"large_page_aligned_free munmap(" << ptr <<
", " << n_bytes_rounded
107 "superpage size is not the one that has been expected (2MB). In case this \
108 is a wanted change, please tweak this static_assert _and_ modify this function \
109 to return appropriate new superpage size value.");
110 return 2 * 1024 * 1024;
const size_t large_page_default_size
System-default huge (large) page setting.
Definition: ut0new.cc:39
constexpr bool unlikely(bool expr)
Definition: my_compiler.h:57
Definition: ut0tuple.h:56
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:56
void * large_page_aligned_alloc(size_t n_bytes)
Allocates memory backed by large (huge) pages.
Definition: large_page_alloc-linux.h:51
static constexpr auto SUPER_PAGE_SIZE
Superpage size to be used (2MB).
Definition: large_page_alloc-osx.h:48
bool large_page_aligned_free(void *ptr, size_t n_bytes)
Releases memory backed by large (huge) pages.
Definition: large_page_alloc-linux.h:74
size_t large_page_size()
Queries the current size of large (huge) pages on running system.
Definition: large_page_alloc-linux.h:94
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:47
Base of InnoDB utilities.