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

ACE_Shared_Memory_Pool Class Reference

Make a memory pool that is based on System V shared memory (shmget(2) etc.). This implementation allows memory to be shared between processes. If your platform doesn't support System V shared memory (e.g., Win32 and many RTOS platforms do not) then you should use <ACE_MMAP_Memory_Pool> instead of this class. In fact, you should probably use <ACE_MMAP_Memory_Pool> on platforms that *do* support System V shared memory since it provides more powerful features, such as persistent backing store and greatly scalability. More...

#include <Memory_Pool.h>

Inheritance diagram for ACE_Shared_Memory_Pool:

Inheritance graph
[legend]
Collaboration diagram for ACE_Shared_Memory_Pool:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Shared_Memory_Pool_Options OPTIONS

Public Methods

 ACE_Shared_Memory_Pool (const ACE_TCHAR *backing_store_name=0, const OPTIONS *options=0)
 Initialize the pool. More...

virtual ~ACE_Shared_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)
virtual int release (int destroy=1)
 Instruct the memory pool to release all of its resources. More...

virtual int sync (ssize_t len=-1, int flags=MS_SYNC)
 Sync 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 the memory region to the backing store starting at <addr_>. More...

virtual int protect (ssize_t len=-1, int prot=PROT_RDWR)
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 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...

virtual int commit_backing_store_name (size_t rounded_bytes, off_t &offset)
virtual int find_seg (const void *const searchPtr, off_t &offset, size_t &counter)
 Find the segment that contains the searchPtr. More...

virtual int in_use (off_t &offset, size_t &counter)
 Determine how much memory is currently in use. More...

virtual int handle_signal (int signum, siginfo_t *, ucontext_t *)
 Handle SIGSEGV and SIGBUS signals to remap shared memory properly. More...


Protected Attributes

void * base_addr_
size_t file_perms_
 File permissions to use when creating/opening a segment. More...

size_t max_segments_
 Number of shared memory segments in the <SHM_TABLE> table. More...

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

size_t segment_size_
 Shared memory segment size. More...

key_t base_shm_key_
 Base shared memory key for the segment. More...

ACE_Sig_Handler signal_handler_
 Handles SIGSEGV. More...


Detailed Description

Make a memory pool that is based on System V shared memory (shmget(2) etc.). This implementation allows memory to be shared between processes. If your platform doesn't support System V shared memory (e.g., Win32 and many RTOS platforms do not) then you should use <ACE_MMAP_Memory_Pool> instead of this class. In fact, you should probably use <ACE_MMAP_Memory_Pool> on platforms that *do* support System V shared memory since it provides more powerful features, such as persistent backing store and greatly scalability.

Definition at line 163 of file Memory_Pool.h.


Member Typedef Documentation

typedef ACE_Shared_Memory_Pool_Options ACE_Shared_Memory_Pool::OPTIONS
 

Definition at line 166 of file Memory_Pool.h.


Constructor & Destructor Documentation

ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool const ACE_TCHAR   backing_store_name = 0,
const OPTIONS   options = 0
 

Initialize the pool.

Definition at line 825 of file Memory_Pool.cpp.

References ACE_DEFAULT_FILE_PERMS, ACE_DEFAULT_MAX_SEGMENTS, ACE_DEFAULT_SEGMENT_SIZE, ACE_DEFAULT_SHM_KEY, ACE_ERROR, ACE_LIB_TEXT, ACE_TCHAR, ACE_TRACE, base_addr_, base_shm_key_, ACE::crc32, file_perms_, IPC_PRIVATE, LM_ERROR, max_segments_, minimum_bytes_, ACE_Sig_Handler::register_handler, segment_size_, signal_handler_, and SIGSEGV.

00827   : base_addr_ (0),
00828     file_perms_ (ACE_DEFAULT_FILE_PERMS),
00829     max_segments_ (ACE_DEFAULT_MAX_SEGMENTS),
00830     minimum_bytes_ (0),
00831     segment_size_ (ACE_DEFAULT_SEGMENT_SIZE)
00832 {
00833   ACE_TRACE ("ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool");
00834 
00835   // Only change the defaults if <options> != 0.
00836   if (options)
00837     {
00838       this->base_addr_ =
00839         ACE_reinterpret_cast (void *,
00840                               ACE_const_cast (char *,
00841                                               options->base_addr_));
00842       this->max_segments_ = options->max_segments_;
00843       this->file_perms_ = options->file_perms_;
00844       this->minimum_bytes_ = options->minimum_bytes_;
00845       this->segment_size_ = options->segment_size_;
00846     }
00847 
00848   if (backing_store_name)
00849     {
00850       // Convert the string into a number that is used as the segment
00851       // key.
00852 
00853       int segment_key;
00854       int result = ::sscanf (backing_store_name,
00855                              "%d",
00856                              &segment_key);
00857 
00858       if (result == 0 || result == EOF)
00859         // The conversion to a number failed so hash with crc32
00860         // ACE::crc32 is also used in <SV_Semaphore_Simple>.
00861         this->base_shm_key_ = (key_t) ACE::crc32 (backing_store_name);
00862       else
00863         this->base_shm_key_ = segment_key;
00864 
00865       if (this->base_shm_key_ == IPC_PRIVATE)
00866         // Make sure that the segment can be shared between unrelated
00867         // processes.
00868         this->base_shm_key_ = ACE_DEFAULT_SHM_KEY;
00869     }
00870   else
00871     this->base_shm_key_ = ACE_DEFAULT_SHM_KEY;
00872 
00873   if (this->signal_handler_.register_handler (SIGSEGV, this) == -1)
00874     ACE_ERROR ((LM_ERROR,
00875                 ACE_LIB_TEXT ("%p\n"),
00876                 ACE_LIB_TEXT ("ACE_Sig_Handler::register_handler")));
00877 }

ACE_INLINE ACE_Shared_Memory_Pool::~ACE_Shared_Memory_Pool void    [virtual]
 

Definition at line 99 of file Memory_Pool.i.

00100 {
00101 }


Member Function Documentation

void * ACE_Shared_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. Also acquires an internal semaphore that ensures proper serialization of Memory_Pool initialization across processes.

Definition at line 882 of file Memory_Pool.cpp.

References ACE_TRACE, base_addr_, commit_backing_store_name, and round_up.

00884 {
00885   ACE_TRACE ("ACE_Shared_Memory_Pool::acquire");
00886 
00887   rounded_bytes = this->round_up (nbytes);
00888 
00889   // ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("(%P|%t) acquiring more chunks, nbytes = %d, rounded_bytes = %d\n"), nbytes, rounded_bytes));
00890 
00891   off_t offset;
00892 
00893   if (this->commit_backing_store_name (rounded_bytes, offset) == -1)
00894     return 0;
00895 
00896   // ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("(%P|%t) acquired more chunks, nbytes = %d, rounded_bytes = %d\n"), nbytes, rounded_bytes));
00897   return ((char *) this->base_addr_) + offset;
00898 }

ACE_INLINE void * ACE_Shared_Memory_Pool::base_addr void    const [virtual]
 

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

Definition at line 142 of file Memory_Pool.i.

References ACE_TRACE, and base_addr_.

00143 {
00144   ACE_TRACE ("ACE_Shared_Memory_Pool::base_addr");
00145   return this->base_addr_;
00146 }

int ACE_Shared_Memory_Pool::commit_backing_store_name size_t    rounded_bytes,
off_t &    offset
[protected, virtual]
 

Commits a new shared memory segment if necessary after an <acquire> or a signal. <offset> is set to the new offset into the backing store.

Definition at line 698 of file Memory_Pool.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_TRACE, base_addr_, in_use, IPC_CREAT, IPC_EXCL, LM_ERROR, max_segments_, ACE_OS::shmat, and ACE_OS::shmget.

Referenced by acquire.

00700 {
00701   ACE_TRACE ("ACE_Shared_Memory_Pool::commit_backing_store_name");
00702 
00703   size_t counter;
00704   SHM_TABLE *st = ACE_reinterpret_cast (SHM_TABLE *,
00705                                         this->base_addr_);
00706 
00707   if (this->in_use (offset, counter) == -1)
00708     return -1;
00709 
00710   if (counter == this->max_segments_)
00711     ACE_ERROR_RETURN ((LM_ERROR,
00712                       "exceeded max number of segments = %d, base = %u, offset = %u\n",
00713                        counter,
00714                        this->base_addr_,
00715                        offset),
00716                       -1);
00717   else
00718     {
00719       int shmid = ACE_OS::shmget (st[counter].key_,
00720                                   rounded_bytes,
00721                                   this->file_perms_ | IPC_CREAT | IPC_EXCL);
00722       if (shmid == -1)
00723         ACE_ERROR_RETURN ((LM_ERROR,
00724                            ACE_LIB_TEXT ("(%P|%t) %p\n"),
00725                            ACE_LIB_TEXT ("shmget")),
00726                           0);
00727       st[counter].shmid_ = shmid;
00728       st[counter].used_ = 1;
00729 
00730       void *address = (void *) (((char *) this->base_addr_) + offset);
00731       void *shmem = ACE_OS::shmat (st[counter].shmid_,
00732                                    (char *) address,
00733                                    0);
00734 
00735       if (shmem != address)
00736         ACE_ERROR_RETURN ((LM_ERROR,
00737                            "(%P|%t) %p, shmem = %u, address = %u\n",
00738                            "shmat",
00739                            shmem,
00740                            address),
00741                           0);
00742     }
00743   return 0;
00744 }

void ACE_Shared_Memory_Pool::dump void    const [virtual]
 

Dump the state of an object.

Definition at line 630 of file Memory_Pool.cpp.

References ACE_TRACE.

00631 {
00632   ACE_TRACE ("ACE_Shared_Memory_Pool::dump");
00633 }

int ACE_Shared_Memory_Pool::find_seg const void *const    searchPtr,
off_t &    offset,
size_t &    counter
[protected, virtual]
 

Find the segment that contains the searchPtr.

Definition at line 661 of file Memory_Pool.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, base_addr_, IPC_STAT, LM_ERROR, max_segments_, and ACE_OS::shmctl.

Referenced by handle_signal.

00664 {
00665   offset = 0;
00666   SHM_TABLE *st = ACE_reinterpret_cast (SHM_TABLE *,
00667                                         this->base_addr_);
00668   shmid_ds buf;
00669 
00670   for (counter = 0;
00671        counter < this->max_segments_
00672          && st[counter].used_ == 1;
00673        counter++)
00674     {
00675       if (ACE_OS::shmctl (st[counter].shmid_, IPC_STAT, &buf) == -1)
00676         ACE_ERROR_RETURN ((LM_ERROR,
00677                            ACE_LIB_TEXT ("(%P|%t) %p\n"),
00678                            ACE_LIB_TEXT ("shmctl")),
00679                           -1);
00680       offset += buf.shm_segsz;
00681 
00682       // If segment 'counter' starts at a location greater than the
00683       // place we are searching for. We then decrement the offset to
00684       // the start of counter-1. (flabar@vais.net)
00685       if (((ptrdiff_t) offset + (ptrdiff_t) (this->base_addr_)) > (ptrdiff_t) searchPtr)
00686         {
00687           --counter;
00688           offset -= buf.shm_segsz;
00689           return 0;
00690         }
00691       // ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("(%P|%t) segment size = %d, offset = %d\n"), buf.shm_segsz, offset));
00692     }
00693 
00694   return 0;
00695 }

int ACE_Shared_Memory_Pool::handle_signal int    signum,
siginfo_t  ,
ucontext_t  
[protected, virtual]
 

Handle SIGSEGV and SIGBUS signals to remap shared memory properly.

Reimplemented from ACE_Event_Handler.

Definition at line 749 of file Memory_Pool.cpp.

References ACE_ERROR, ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_TRACE, base_addr_, find_seg, in_use, LM_ERROR, ACE_OS::shmat, and ucontext_t.

00750 {
00751   ACE_TRACE ("ACE_Shared_Memory_Pool::handle_signal");
00752   // ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("signal %S occurred\n"), signum));
00753 
00754 #if defined (ACE_HAS_SIGINFO_T) && !defined (ACE_LACKS_SI_ADDR)
00755   off_t offset;
00756   // Make sure that the pointer causing the problem is within the
00757   // range of the backing store.
00758 
00759   if (siginfo != 0)
00760     {
00761       // ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("(%P|%t) si_signo = %d, si_code = %d, addr = %u\n"), siginfo->si_signo, siginfo->si_code, siginfo->si_addr));
00762       size_t counter;
00763       if (this->in_use (offset, counter) == -1)
00764         ACE_ERROR ((LM_ERROR,
00765                     ACE_LIB_TEXT ("(%P|%t) %p\n"),
00766                     ACE_LIB_TEXT ("in_use")));
00767 #if !defined(_UNICOS)
00768       else if (!(siginfo->si_code == SEGV_MAPERR
00769            && siginfo->si_addr < (((char *) this->base_addr_) + offset)
00770            && siginfo->si_addr >= ((char *) this->base_addr_)))
00771         ACE_ERROR_RETURN ((LM_ERROR,
00772                            "(%P|%t) address %u out of range\n",
00773                            siginfo->si_addr),
00774                           -1);
00775 #else /* ! _UNICOS */
00776       else if (!(siginfo->si_code == SEGV_MEMERR
00777            && siginfo->si_addr < (((unsigned long) this->base_addr_) + offset)
00778            && siginfo->si_addr >= ((unsigned long) this->base_addr_)))
00779         ACE_ERROR_RETURN ((LM_ERROR,
00780                            "(%P|%t) address %u out of range\n",
00781                            siginfo->si_addr),
00782                           -1);
00783 #endif /* ! _UNICOS */
00784     }
00785 
00786   // The above if case will check to see that the address is in the
00787   // proper range.  Therefore there is a segment out there that the
00788   // pointer wants to point into.  Find the segment that someone else
00789   // has used and attach to it (flabar@vais.net)
00790 
00791   size_t counter; // ret value to get shmid from the st table.
00792 
00793 #if !defined(_UNICOS)
00794   if (this->find_seg (siginfo->si_addr, offset, counter) == -1)
00795 #else /* ! _UNICOS */
00796   if (this->find_seg ((const void *)siginfo->si_addr, offset, counter) == -1)
00797 #endif /* ! _UNICOS */
00798       ACE_ERROR_RETURN ((LM_ERROR,
00799                          ACE_LIB_TEXT ("(%P|%t) %p\n"),
00800                          ACE_LIB_TEXT ("in_use")),
00801                         -1);
00802 
00803   void *address = (void *) (((char *) this->base_addr_) + offset);
00804   SHM_TABLE *st = ACE_reinterpret_cast (SHM_TABLE *,
00805                                         this->base_addr_);
00806 
00807   void *shmem = ACE_OS::shmat (st[counter].shmid_, (char *) address, 0);
00808 
00809   if (shmem != address)
00810       ACE_ERROR_RETURN ((LM_ERROR,
00811                          "(%P|%t) %p, shmem = %u, address = %u\n",
00812                          "shmat",
00813                          shmem,
00814                          address),
00815                         0);
00816 
00817   // NOTE: this won't work if we dont have SIGINFO_T or SI_ADDR
00818 #else
00819   ACE_UNUSED_ARG (siginfo);
00820 #endif /* ACE_HAS_SIGINFO_T && !defined (ACE_LACKS_SI_ADDR) */
00821 
00822   return 0;
00823 }

int ACE_Shared_Memory_Pool::in_use off_t &    offset,
size_t &    counter
[protected, virtual]
 

Determine how much memory is currently in use.

Definition at line 636 of file Memory_Pool.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, IPC_STAT, LM_ERROR, max_segments_, and ACE_OS::shmctl.

Referenced by commit_backing_store_name, and handle_signal.

00638 {
00639   offset = 0;
00640   SHM_TABLE *st = ACE_reinterpret_cast (SHM_TABLE *,
00641                                         this->base_addr_);
00642   shmid_ds buf;
00643 
00644   for (counter = 0;
00645        counter < this->max_segments_ && st[counter].used_ == 1;
00646        counter++)
00647     {
00648       if (ACE_OS::shmctl (st[counter].shmid_, IPC_STAT, &buf) == -1)
00649         ACE_ERROR_RETURN ((LM_ERROR,
00650                            ACE_LIB_TEXT ("(%P|%t) %p\n"),
00651                            ACE_LIB_TEXT ("shmctl")),
00652                           -1);
00653       offset += buf.shm_segsz;
00654       // ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("(%P|%t) segment size = %d, offset = %d\n"), buf.shm_segsz, offset));
00655     }
00656 
00657   return 0;
00658 }

void * ACE_Shared_Memory_Pool::init_acquire size_t    nbytes,
size_t &    rounded_bytes,
int &    first_time
[virtual]
 

Ask system for initial chunk of local memory.

Definition at line 903 of file Memory_Pool.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_TRACE, base_addr_, base_shm_key_, IPC_CREAT, IPC_EXCL, LM_ERROR, max_segments_, ACE::round_to_pagesize, round_up, ACE_OS::shmat, and ACE_OS::shmget.

00906 {
00907   ACE_TRACE ("ACE_Shared_Memory_Pool::init_acquire");
00908 
00909   off_t shm_table_offset = ACE::round_to_pagesize (sizeof (SHM_TABLE));
00910   rounded_bytes = this->round_up (nbytes > (size_t) this->minimum_bytes_
00911                                   ? nbytes
00912                                   : (size_t) this->minimum_bytes_);
00913 
00914   // Acquire the semaphore to serialize initialization and prevent
00915   // race conditions.
00916 
00917   int shmid = ACE_OS::shmget (this->base_shm_key_,
00918                               rounded_bytes + shm_table_offset,
00919                               this->file_perms_ | IPC_CREAT | IPC_EXCL);
00920   if (shmid == -1)
00921     {
00922       if (errno != EEXIST)
00923         ACE_ERROR_RETURN ((LM_ERROR,
00924                            ACE_LIB_TEXT ("(%P|%t) %p\n"),
00925                            ACE_LIB_TEXT ("shmget")),
00926                           0);
00927       first_time = 0;
00928 
00929       shmid = ACE_OS::shmget (this->base_shm_key_, 0, 0);
00930 
00931       if (shmid == -1)
00932         ACE_ERROR_RETURN ((LM_ERROR,
00933                            ACE_LIB_TEXT ("(%P|%t) %p\n"),
00934                            ACE_LIB_TEXT ("shmget")),
00935                           0);
00936 
00937       // This implementation doesn't care if we don't get the key we
00938       // want...
00939       this->base_addr_ =
00940         ACE_OS::shmat (shmid,
00941                        ACE_reinterpret_cast (char *,
00942                                              this->base_addr_),
00943                        0);
00944       if (this->base_addr_ == ACE_reinterpret_cast (void *, -1))
00945         ACE_ERROR_RETURN ((LM_ERROR,
00946                            "(%P|%t) %p, base_addr = %u\n",
00947                            "shmat",
00948                            this->base_addr_),
00949                           0);
00950     }
00951   else
00952     {
00953       first_time = 1;
00954 
00955       // This implementation doesn't care if we don't get the key we
00956       // want...
00957       this->base_addr_ =
00958         ACE_OS::shmat (shmid,
00959                        ACE_reinterpret_cast (char *,
00960                                              this->base_addr_),
00961                        0);
00962       if (this->base_addr_ == ACE_reinterpret_cast (char *, -1))
00963         ACE_ERROR_RETURN ((LM_ERROR,
00964                            "(%P|%t) %p, base_addr = %u\n",
00965                            "shmat",
00966                            this->base_addr_), 0);
00967 
00968       SHM_TABLE *st = ACE_reinterpret_cast (SHM_TABLE *,
00969                                             this->base_addr_);
00970       st[0].key_ = this->base_shm_key_;
00971       st[0].shmid_ = shmid;
00972 
00973       st[0].used_ = 1;
00974 
00975       for (size_t counter = 1; // Skip over the first entry...
00976            counter < this->max_segments_;
00977            counter++)
00978         {
00979           st[counter].key_ = this->base_shm_key_ + counter;
00980           st[counter].shmid_ = 0;
00981           st[counter].used_ = 0;
00982         }
00983     }
00984 
00985   return (void *) (((char *) this->base_addr_) + shm_table_offset);
00986 }

ACE_INLINE int ACE_Shared_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.

Definition at line 135 of file Memory_Pool.i.

References ACE_TRACE.

00136 {
00137   ACE_TRACE ("ACE_Shared_Memory_Pool::protect");
00138   return 0;
00139 }

ACE_INLINE int ACE_Shared_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.

Definition at line 128 of file Memory_Pool.i.

References ACE_TRACE, and ssize_t.

00129 {
00130   ACE_TRACE ("ACE_Shared_Memory_Pool::protect");
00131   return 0;
00132 }

int ACE_Shared_Memory_Pool::release int    destroy = 1 [virtual]
 

Instruct the memory pool to release all of its resources.

Definition at line 991 of file Memory_Pool.cpp.

References ACE_TRACE, IPC_RMID, max_segments_, and ACE_OS::shmctl.

00992 {
00993   ACE_TRACE ("ACE_Shared_Memory_Pool::release");
00994 
00995   int result = 0;
00996   SHM_TABLE *st = ACE_reinterpret_cast (SHM_TABLE *,
00997                                         this->base_addr_);
00998 
00999   for (size_t counter = 0;
01000        counter < this->max_segments_ && st[counter].used_ == 1;
01001        counter++)
01002     if (ACE_OS::shmctl (st[counter].shmid_, IPC_RMID, 0) == -1)
01003       result = -1;
01004 
01005   return result;
01006 }

ACE_INLINE size_t ACE_Shared_Memory_Pool::round_up size_t    nbytes [protected, virtual]
 

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

Definition at line 104 of file Memory_Pool.i.

References ACE_TRACE, ACE::round_to_pagesize, and segment_size_.

Referenced by acquire, and init_acquire.

00105 {
00106   ACE_TRACE ("ACE_Shared_Memory_Pool::round_up");
00107   if (nbytes < this->segment_size_)
00108     nbytes = this->segment_size_;
00109 
00110   return ACE::round_to_pagesize (nbytes);
00111 }

ACE_INLINE int ACE_Shared_Memory_Pool::sync void *    addr,
size_t    len,
int    flags = MS_SYNC
[virtual]
 

Sync the memory region to the backing store starting at <addr_>.

Definition at line 121 of file Memory_Pool.i.

References ACE_TRACE.

00122 {
00123   ACE_TRACE ("ACE_Shared_Memory_Pool::sync");
00124   return 0;
00125 }

ACE_INLINE int ACE_Shared_Memory_Pool::sync ssize_t    len = -1,
int    flags = MS_SYNC
[virtual]
 

Sync the memory region to the backing store starting at <this->base_addr_>.

Definition at line 114 of file Memory_Pool.i.

References ACE_TRACE, and ssize_t.

00115 {
00116   ACE_TRACE ("ACE_Shared_Memory_Pool::sync");
00117   return 0;
00118 }


Member Data Documentation

ACE_Shared_Memory_Pool::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 217 of file Memory_Pool.h.

void* ACE_Shared_Memory_Pool::base_addr_ [protected]
 

Base address of the shared memory segment. If this has the value of 0 then the OS is free to select any address, otherwise this value is what the OS must try to use to map the shared memory segment.

Definition at line 251 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool, acquire, base_addr, commit_backing_store_name, find_seg, handle_signal, and init_acquire.

key_t ACE_Shared_Memory_Pool::base_shm_key_ [protected]
 

Base shared memory key for the segment.

Definition at line 266 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool, and init_acquire.

size_t ACE_Shared_Memory_Pool::file_perms_ [protected]
 

File permissions to use when creating/opening a segment.

Definition at line 254 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool.

size_t ACE_Shared_Memory_Pool::max_segments_ [protected]
 

Number of shared memory segments in the <SHM_TABLE> table.

Definition at line 257 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool, commit_backing_store_name, find_seg, in_use, init_acquire, and release.

off_t ACE_Shared_Memory_Pool::minimum_bytes_ [protected]
 

What the minimim bytes of the initial segment should be.

Definition at line 260 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool.

size_t ACE_Shared_Memory_Pool::segment_size_ [protected]
 

Shared memory segment size.

Definition at line 263 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool, and round_up.

ACE_Sig_Handler ACE_Shared_Memory_Pool::signal_handler_ [protected]
 

Handles SIGSEGV.

Definition at line 278 of file Memory_Pool.h.

Referenced by ACE_Shared_Memory_Pool.


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