Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Local_Memory_Pool Class Reference

Make a memory pool that is based on C++ new/delete. This is useful for integrating existing components that use new/delete into the ACE Malloc scheme... More...

`#include <Memory_Pool.h>`

Collaboration diagram for ACE_Local_Memory_Pool:

[legend]
List of all members.

## Public Types
typedef ACE_Local_Memory_Pool_Options | OPTIONS
## Public Methods
| ACE_Local_Memory_Pool (const ACE_TCHAR *backing_store_name=0, const OPTIONS *options=0)
| Initialize the pool. More...
virtual | ~ACE_Local_Memory_Pool (void)
virtual void * | init_acquire (size_t nbytes, size_t &rounded_bytes, int &first_time)
| Ask system for initial chunk of local memory. More...
virtual void * | 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. More...
virtual int | release (void)
| Instruct the memory pool to release all of its resources. More...
virtual int | sync (ssize_t len=-1, int flags=MS_SYNC)
| Sync <len> bytes of the memory region to the backing store starting at <this->base_addr_>. More...
virtual int | sync (void *addr, size_t len, int flags=MS_SYNC)
| Sync <len> bytes of the memory region to the backing store starting at <addr_>. More...
virtual int | protect (ssize_t len=-1, int prot=PROT_RDWR)
| Change the protection of the pages of the mapped region to <prot> starting at <this->base_addr_> up to <len> bytes. More...
virtual int | protect (void *addr, size_t len, int prot=PROT_RDWR)
| Change the protection of the pages of the mapped region to <prot> starting at <addr> up to <len> bytes. More...
virtual int | seh_selector (void *)
| Win32 Structural exception selector. More...
virtual int | remap (void *addr)
| Try to extend the virtual address space so that <addr> is now covered by the address mapping. More...
virtual void * | base_addr (void) const
| Return the base address of this memory pool, 0 if base_addr never changes. More...
virtual void | dump (void) const
| Dump the state of an object. More...
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...
## Protected Methods
virtual size_t | round_up (size_t nbytes)
| Implement the algorithm for rounding up the request to an appropriate chunksize. More...
## Protected Attributes
ACE_Unbounded_Set< char *> | allocated_chunks_
| List of memory that we have allocated. More...

## Detailed Description

Make a memory pool that is based on C++ new/delete. This is useful for integrating existing components that use new/delete into the ACE Malloc scheme...

## Member Typedef Documentation

typedef ACE_Local_Memory_Pool_Options ACE_Local_Memory_Pool::OPTIONS

## Constructor & Destructor Documentation

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

| Initialize the pool.

ACE_INLINE ACE_Local_Memory_Pool::~ACE_Local_Memory_Pool | ( | void |  | ) | `[virtual]`

## Member Function Documentation

void * ACE_Local_Memory_Pool::acquire | ( | size_t | nbytes,
|  | size_t & | rounded_bytes
| ) | `[virtual]`

| Acquire at least NBYTES from the memory pool. ROUNDED_BYTES is the actual number of bytes allocated.

ACE_INLINE void * ACE_Local_Memory_Pool::base_addr | ( | void |  | ) | const`[virtual]`

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

void ACE_Local_Memory_Pool::dump | ( | void |  | ) | const`[virtual]`

| Dump the state of an object.

ACE_INLINE void * ACE_Local_Memory_Pool::init_acquire | ( | size_t | nbytes,
|  | size_t & | rounded_bytes,
|  | int & | first_time
| ) | `[virtual]`

| Ask system for initial chunk of local memory.

ACE_INLINE int ACE_Local_Memory_Pool::protect | ( | void * | addr,
|  | size_t | len,
|  | int | prot = PROT_RDWR
| ) | `[virtual]`

| Change the protection of the pages of the mapped region to <prot> starting at <addr> up to <len> bytes.

ACE_INLINE int ACE_Local_Memory_Pool::protect | ( | ssize_t | len = -1,
|  | int | prot = PROT_RDWR
| ) | `[virtual]`

| Change the protection of the pages of the mapped region to <prot> starting at <this->base_addr_> up to <len> bytes. If <len> == -1 then change protection of all pages in the mapped region.

int ACE_Local_Memory_Pool::release | ( | void |  | ) | `[virtual]`

| Instruct the memory pool to release all of its resources.

int ACE_Local_Memory_Pool::remap | ( | void * | addr | ) | `[virtual]`

| Try to extend the virtual address space so that <addr> is now covered by the address mapping. Always returns 0 since we can't remap a local memory pool.

ACE_INLINE size_t ACE_Local_Memory_Pool::round_up | ( | size_t | nbytes | ) | `[protected, virtual]`

| Implement the algorithm for rounding up the request to an appropriate chunksize.

int ACE_Local_Memory_Pool::seh_selector | ( | void * |  | ) | `[virtual]`

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

ACE_INLINE int ACE_Local_Memory_Pool::sync | ( | void * | addr,
|  | size_t | len,
|  | int | flags = MS_SYNC
| ) | `[virtual]`

| Sync <len> bytes of the memory region to the backing store starting at <addr_>.

ACE_INLINE int ACE_Local_Memory_Pool::sync | ( | ssize_t | len = -1,
|  | int | flags = MS_SYNC
| ) | `[virtual]`

| Sync <len> bytes of the memory region to the backing store starting at <this->base_addr_>. If <len> == -1 then sync the whole region.

## Member Data Documentation

ACE_Local_Memory_Pool::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks.

ACE_Unbounded_Set<char *> ACE_Local_Memory_Pool::allocated_chunks_`[protected]`

| List of memory that we have allocated.

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

- Memory_Pool.h
- Memory_Pool.cpp
- Memory_Pool.i