class Mmap

ColdStore Mmap manager More...

Definition#include <qvmm.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members


Detailed Description

ColdStore Mmap manager

Mmap maintains the store, providing

const size_t max

maximum size of store (page aligned)

const size_t page_size

underlying page size of store (power of 2)

bool initialized

flag: is Mmap initialized?

size_t open ( int fd)
[static]

Mmap the file as a store.

Parameters:
fdfile descriptor of open store

Returns: current size of store

int open (char *file)
[static]

Open and Mmap the named file as a store.

Parameters:
filefile name

Returns: file descriptor of open store

void close ( int fd)
[static]

close the Mmap

Parameters:
fdfile descriptor of open store

void* alloc ( size_t size)
[static]

Allocate a range of pages in the store

Parameters:
sizesize of allocation

Returns: allocated region

int check ( void* ptr)
[static]

check the validity of a pointer

Parameters:
ptrpointer to be checked

Returns: true if the pointer is in the Mmap

size_t align ( size_t size)
[static]

align a value to a page boundary

Parameters:
sizevalue to align

Returns: page-aligned value

void* pageof ( void* ptr)
[static]

return the page which contains a pointer

Parameters:
ptrpointer to align

Returns: page-aligned pointer