Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
uvm.cpp File Reference
#include "precompiled.h"
#include "lib/sysdep/vm.h"
#include "lib/alignment.h"
Include dependency graph for uvm.cpp:

Namespaces

namespace  vm
 

Macros

#define MAP_ANONYMOUS   MAP_ANON
 

Functions

void * vm::ReserveAddressSpace (size_t size, size_t commitSize=g_LargePageSize, PageType pageType=kDefault, int prot=PROT_READ|PROT_WRITE)
 reserve address space and set the parameters for any later on-demand commits. More...
 
void vm::ReleaseAddressSpace (void *p, size_t size=0)
 release address space and decommit any memory. More...
 
bool vm::Commit (uintptr_t address, size_t size, PageType pageType=kDefault, int prot=PROT_READ|PROT_WRITE)
 map physical memory to previously reserved address space. More...
 
bool vm::Decommit (uintptr_t address, size_t size)
 unmap physical memory. More...
 
bool vm::Protect (uintptr_t address, size_t size, int prot)
 set the memory protection flags for all pages that intersect the given interval. More...
 
void * vm::Allocate (size_t size, PageType pageType=kDefault, int prot=PROT_READ|PROT_WRITE)
 reserve address space and commit memory. More...
 
void vm::Free (void *p, size_t size=0)
 decommit memory and release address space. More...
 
void vm::BeginOnDemandCommits ()
 install a handler that attempts to commit memory whenever a read/write page fault is encountered. More...
 
void vm::EndOnDemandCommits ()
 decrements the reference count begun by BeginOnDemandCommit and removes the page fault handler when it reaches 0. More...
 
void vm::DumpStatistics ()
 

Variables

static const int mmap_flags = MAP_PRIVATE|MAP_ANONYMOUS
 

Macro Definition Documentation

◆ MAP_ANONYMOUS

#define MAP_ANONYMOUS   MAP_ANON

Variable Documentation

◆ mmap_flags

const int mmap_flags = MAP_PRIVATE|MAP_ANONYMOUS
static