ACE 8.0.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ACE_Pagefile_Memory_Pool Class Reference

Make a memory pool that is based on "anonymous" memory regions allocated from the Win32 page file. More...

#include <Pagefile_Memory_Pool.h>

Collaboration diagram for ACE_Pagefile_Memory_Pool:
Collaboration graph
[legend]

Classes

class  Control_Block
 Attributes that are meaningful in local storage only. More...
 

Public Types

typedef ACE_Pagefile_Memory_Pool_Options OPTIONS
 

Public Member Functions

 ACE_Pagefile_Memory_Pool (const ACE_TCHAR *backing_store_name=0, const OPTIONS *options=0)
 Initialize the pool.
 
virtual ~ACE_Pagefile_Memory_Pool ()=default
 Destructor.
 
voidinit_acquire (size_t nbytes, size_t &rounded_bytes, int &first_time)
 Ask system for initial chunk of shared memory.
 
voidacquire (size_t nbytes, size_t &rounded_bytes)
 
int release (int destroy=1)
 Instruct the memory pool to release all of its resources.
 
virtual int seh_selector (void *)
 
int remap (void *addr)
 
size_t round_to_page_size (size_t nbytes)
 Round up to system page size.
 
size_t round_to_chunk_size (size_t nbytes)
 Round up to the chunk size required by the operation system.
 
int sync (ssize_t=-1, int=MS_SYNC)
 
int sync (void *, size_t, int=MS_SYNC)
 
int protect (ssize_t=-1, int=PROT_RDWR)
 
int protect (void *, size_t, int=PROT_RDWR)
 
virtual voidbase_addr () const
 
void dump () const
 

Protected Member Functions

int map (int &firstTime, size_t appendBytes=0)
 
int unmap ()
 Release the mapping.
 

Private Attributes

Control_Block local_cb_
 Description of what our process mapped.
 
Control_Blockshared_cb_
 Shared memory pool statistics.
 
ACE_HANDLE object_handle_
 File mapping handle.
 
size_t page_size_
 System page size.
 
ACE_TCHAR backing_store_name_ [MAXPATHLEN]
 Name of the backing store where the shared memory pool is kept.
 

Detailed Description

Make a memory pool that is based on "anonymous" memory regions allocated from the Win32 page file.

Member Typedef Documentation

◆ OPTIONS

Constructor & Destructor Documentation

◆ ACE_Pagefile_Memory_Pool()

ACE_Pagefile_Memory_Pool::ACE_Pagefile_Memory_Pool ( const ACE_TCHAR * backing_store_name = 0,
const OPTIONS * options = 0 )

Initialize the pool.

◆ ~ACE_Pagefile_Memory_Pool()

virtual ACE_Pagefile_Memory_Pool::~ACE_Pagefile_Memory_Pool ( )
virtualdefault

Destructor.

Member Function Documentation

◆ acquire()

void * ACE_Pagefile_Memory_Pool::acquire ( size_t nbytes,
size_t & rounded_bytes )

Acquire at least nbytes from the memory pool. <rounded_bytes> is the actual number of bytes allocated.

◆ base_addr()

void * ACE_Pagefile_Memory_Pool::base_addr ( ) const
inlinevirtual

Return the base address of this memory pool, 0 if base_addr never changes.

◆ dump()

void ACE_Pagefile_Memory_Pool::dump ( ) const
inline

◆ init_acquire()

void * ACE_Pagefile_Memory_Pool::init_acquire ( size_t nbytes,
size_t & rounded_bytes,
int & first_time )

Ask system for initial chunk of shared memory.

◆ map()

int ACE_Pagefile_Memory_Pool::map ( int & firstTime,
size_t appendBytes = 0 )
protected

Map portions or the entire pool into the local virtual address space. To do this, we compute the new file_offset of the backing store and commit the memory.

◆ protect() [1/2]

int ACE_Pagefile_Memory_Pool::protect ( ssize_t = -1,
int = PROT_RDWR )
inline

◆ protect() [2/2]

int ACE_Pagefile_Memory_Pool::protect ( void * ,
size_t ,
int = PROT_RDWR )
inline

◆ release()

int ACE_Pagefile_Memory_Pool::release ( int destroy = 1)

Instruct the memory pool to release all of its resources.

◆ remap()

int ACE_Pagefile_Memory_Pool::remap ( void * addr)

Try to extend the virtual address space so that addr is now covered by the address mapping. The method succeeds and returns 0 if the backing store has adequate memory to cover this address. Otherwise, it returns -1. This method is typically called by an exception handler for a Win32 structured exception when another process has grown the backing store (and its mapping) and our process now incurs a fault because our mapping isn't in range (yet).

◆ round_to_chunk_size()

size_t ACE_Pagefile_Memory_Pool::round_to_chunk_size ( size_t nbytes)
inline

Round up to the chunk size required by the operation system.

◆ round_to_page_size()

size_t ACE_Pagefile_Memory_Pool::round_to_page_size ( size_t nbytes)
inline

Round up to system page size.

◆ seh_selector()

int ACE_Pagefile_Memory_Pool::seh_selector ( void * ep)
virtual

Win32 Structural exception selector. The return value decides how to handle memory pool related structural exceptions. Returns 1, 0, or , -1.

◆ sync() [1/2]

int ACE_Pagefile_Memory_Pool::sync ( ssize_t = -1,
int = MS_SYNC )
inline

◆ sync() [2/2]

int ACE_Pagefile_Memory_Pool::sync ( void * ,
size_t ,
int = MS_SYNC )
inline

◆ unmap()

int ACE_Pagefile_Memory_Pool::unmap ( )
protected

Release the mapping.

Member Data Documentation

◆ backing_store_name_

ACE_TCHAR ACE_Pagefile_Memory_Pool::backing_store_name_[MAXPATHLEN]
private

Name of the backing store where the shared memory pool is kept.

◆ local_cb_

Control_Block ACE_Pagefile_Memory_Pool::local_cb_
private

Description of what our process mapped.

◆ object_handle_

ACE_HANDLE ACE_Pagefile_Memory_Pool::object_handle_
private

File mapping handle.

◆ page_size_

size_t ACE_Pagefile_Memory_Pool::page_size_
private

System page size.

◆ shared_cb_

Control_Block* ACE_Pagefile_Memory_Pool::shared_cb_
private

Shared memory pool statistics.


The documentation for this class was generated from the following files: