|
void * | ReserveAddressSpace (size_t size, size_t commitSize=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 | ReleaseAddressSpace (void *p, size_t size=0) |
| release address space and decommit any memory. More...
|
|
bool | 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 | Decommit (uintptr_t address, size_t size) |
| unmap physical memory. More...
|
|
bool | Protect (uintptr_t address, size_t size, int prot) |
| set the memory protection flags for all pages that intersect the given interval. More...
|
|
void * | Allocate (size_t size, PageType pageType=kDefault, int prot=PROT_READ|PROT_WRITE) |
| reserve address space and commit memory. More...
|
|
void | Free (void *p, size_t size=0) |
| decommit memory and release address space. More...
|
|
void | BeginOnDemandCommits () |
| install a handler that attempts to commit memory whenever a read/write page fault is encountered. More...
|
|
void | EndOnDemandCommits () |
| decrements the reference count begun by BeginOnDemandCommit and removes the page fault handler when it reaches 0. More...
|
|
void | DumpStatistics () |
|
| CACHE_ALIGNED (struct Statistics) |
|
static bool | ShouldUseLargePages (size_t allocationSize, DWORD allocationType, PageType pageType) |
|
static void * | AllocateLargeOrSmallPages (uintptr_t address, size_t size, DWORD allocationType, PageType pageType=kDefault, int prot=PROT_READ|PROT_WRITE) |
|
| CACHE_ALIGNED (struct AddressRangeDescriptor) |
|
static AddressRangeDescriptor * | FindDescriptor (uintptr_t address) |
|
| TIMER_ADD_CLIENT (tc_commit) |
|
static LONG CALLBACK | VectoredHandler (const PEXCEPTION_POINTERS ep) |
|
static Status | InitHandler () |
|
static void | ShutdownHandler () |
|
LIB_API 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.
- Parameters
-
address,size | need not be aligned, but this function commits any pages intersecting that interval. |
pageType,prot | - see ReserveAddressSpace. |
- Returns
- whether memory was successfully committed.
note: committing only maps virtual pages and does not actually allocate page frames. Windows XP uses a first-touch heuristic - the page will be taken from the node whose processor caused the fault. therefore, worker threads should be the first to write to their memory.
(this is surprisingly slow in XP, possibly due to PFN lock contention)
Definition at line 59 of file uvm.cpp.