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

ACE_MMAP_Memory_Pool_Options Class Reference

Helper class for MMAP Memory Pool constructor options. More...

#include <Memory_Pool.h>

List of all members.

Public Types

enum  { FIRSTCALL_FIXED = 0, ALWAYS_FIXED = 1, NEVER_FIXED = 2 }

Public Methods

 ACE_MMAP_Memory_Pool_Options (const void *base_addr=ACE_DEFAULT_BASE_ADDR, int use_fixed_addr=ALWAYS_FIXED, int write_each_page=1, off_t minimum_bytes=0, u_int flags=0, int guess_on_fault=1, LPSECURITY_ATTRIBUTES sa=0, mode_t file_mode=ACE_DEFAULT_FILE_PERMS)

Public Attributes

const void * base_addr_
 Base address of the memory-mapped backing store. More...

int use_fixed_addr_
int write_each_page_
 Should each page be written eagerly to avoid surprises later on? More...

off_t minimum_bytes_
 What the minimim bytes of the initial segment should be. More...

u_int flags_
 Any special flags that need to be used for <mmap>. More...

int guess_on_fault_
LPSECURITY_ATTRIBUTES sa_
 Pointer to a security attributes object. Only used on NT. More...

mode_t file_mode_
 File mode for mmaped file, if it is created. More...


Detailed Description

Helper class for MMAP Memory Pool constructor options.

This should be a nested class, but that breaks too many compilers.

Definition at line 395 of file Memory_Pool.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
FIRSTCALL_FIXED  The base address from the first call to mmap will be used for subsequent calls to mmap.
ALWAYS_FIXED  The base address specified in base_addr will be used in all calls to mmap.
NEVER_FIXED  The base address will be selected by the OS for each call to mmap. Caution should be used with this mode since a call that requires the backing store to grow may change pointers that are cached by the application.

Definition at line 398 of file Memory_Pool.h.

00399   {
00400     /**
00401      * The base address from the first call to mmap will be used for subsequent
00402      * calls to mmap.
00403      */
00404     FIRSTCALL_FIXED = 0,
00405 
00406     /**
00407      * The base address specified in base_addr will be used in all calls to
00408      * mmap.
00409      */
00410     ALWAYS_FIXED = 1,
00411 
00412     /**
00413      * The base address will be selected by the OS for each call to mmap.
00414      * Caution should be used with this mode since a call that requires the
00415      * backing store to grow may change pointers that are cached by the
00416      * application.
00417      */
00418     NEVER_FIXED = 2
00419   };


Constructor & Destructor Documentation

ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options const void *    base_addr = ACE_DEFAULT_BASE_ADDR,
int    use_fixed_addr = ALWAYS_FIXED,
int    write_each_page = 1,
off_t    minimum_bytes = 0,
u_int    flags = 0,
int    guess_on_fault = 1,
LPSECURITY_ATTRIBUTES    sa = 0,
mode_t    file_mode = ACE_DEFAULT_FILE_PERMS
 

Definition at line 454 of file Memory_Pool.cpp.

References ACE_TRACE, ALWAYS_FIXED, base_addr_, FIRSTCALL_FIXED, mode_t, and use_fixed_addr_.

00462   : base_addr_ (base_addr),
00463     use_fixed_addr_ (use_fixed_addr),
00464     write_each_page_ (write_each_page),
00465     minimum_bytes_ (minimum_bytes),
00466     flags_ (flags),
00467     guess_on_fault_ (guess_on_fault),
00468     sa_ (sa),
00469     file_mode_ (file_mode)
00470 {
00471   ACE_TRACE ("ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options");
00472   // for backwards compatability
00473   if (base_addr_ == 0 && use_fixed_addr_ == ALWAYS_FIXED)
00474     use_fixed_addr_ = FIRSTCALL_FIXED;
00475 
00476   // HP-UX 11, 64-bit bug workaround.
00477 #if defined (__hpux) && defined (__LP64__)
00478   long temp = ACE_DEFAULT_BASE_ADDRL;
00479   base_addr_ = (void *) temp;
00480 #endif /* defined (__hpux) && defined (__LP64__) */
00481 }


Member Data Documentation

const void* ACE_MMAP_Memory_Pool_Options::base_addr_
 

Base address of the memory-mapped backing store.

Definition at line 432 of file Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool_Options.

mode_t ACE_MMAP_Memory_Pool_Options::file_mode_
 

File mode for mmaped file, if it is created.

Definition at line 469 of file Memory_Pool.h.

u_int ACE_MMAP_Memory_Pool_Options::flags_
 

Any special flags that need to be used for <mmap>.

Definition at line 456 of file Memory_Pool.h.

int ACE_MMAP_Memory_Pool_Options::guess_on_fault_
 

Try to remap without knowing the faulting address. This parameter is ignored on platforms that know the faulting address (UNIX with SI_ADDR and Win32).

Definition at line 463 of file Memory_Pool.h.

off_t ACE_MMAP_Memory_Pool_Options::minimum_bytes_
 

What the minimim bytes of the initial segment should be.

Definition at line 453 of file Memory_Pool.h.

LPSECURITY_ATTRIBUTES ACE_MMAP_Memory_Pool_Options::sa_
 

Pointer to a security attributes object. Only used on NT.

Definition at line 466 of file Memory_Pool.h.

int ACE_MMAP_Memory_Pool_Options::use_fixed_addr_
 

Determines whether we set <base_addr_> or if mmap(2) selects it FIRSTCALL_FIXED The base address from the first call to mmap will be used for subsequent calls to mmap ALWAYS_FIXED The base address specified in base_addr will be used in all calls to mmap. NEVER_FIXED The base address will be selected by the OS for each call to mmap. Caution should be used with this mode since a call that requires the backing store to grow may change pointers that are cached by the application.

Definition at line 446 of file Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool_Options.

int ACE_MMAP_Memory_Pool_Options::write_each_page_
 

Should each page be written eagerly to avoid surprises later on?

Definition at line 450 of file Memory_Pool.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:50:40 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002