pstore2
Macros | Functions
memory_mapper_posix.cpp File Reference

POSIX implementation of the platform-independent memory-mapped file. More...

#include "pstore/os/memory_mapper.hpp"
#include <cassert>
#include <cerrno>
#include <limits>
#include <sstream>
#include <sys/mman.h>
#include <unistd.h>
#include "pstore/config/config.hpp"
#include "pstore/support/error.hpp"
#include "pstore/support/quoted.hpp"
Include dependency graph for memory_mapper_posix.cpp:

Macros

#define MAP_ANONYMOUS   MAP_ANON
 

Functions

std::shared_ptr< std::uint8_t > pstore::aligned_valloc (std::size_t size, unsigned align)
 Allocates memory whose start address is a multiple of 'align'. More...
 

Detailed Description

POSIX implementation of the platform-independent memory-mapped file.

Function Documentation

◆ aligned_valloc()

std::shared_ptr< std::uint8_t > pstore::aligned_valloc ( std::size_t  size,
unsigned  align 
)

Allocates memory whose start address is a multiple of 'align'.

This function uses the O/S memory allocation API directly and bypasses operator new/malloc(). This is to ensure that the library can safely change the memory permission (with mprotect() or equivalent).