[6916] Fixed typos in spell checking code.
[getmangos.git] / dep / ACE_wrappers / ace / Sbrk_Memory_Pool.h
blob501994860d986024216457e8f36a7c4616c2857f
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Sbrk_Memory_Pool.h
7 * $Id: Sbrk_Memory_Pool.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Dougls C. Schmidt <schmidt@cs.wustl.edu>
10 * @author Prashant Jain <pjain@cs.wustl.edu>
12 //=============================================================================
14 #ifndef ACE_SBRK_MEMORY_POOL_H
15 #define ACE_SBRK_MEMORY_POOL_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/ACE_export.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #if !defined (ACE_LACKS_SBRK)
27 #include "ace/ACE.h"
28 #include "ace/os_include/sys/os_mman.h"
31 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
33 /**
34 * @class ACE_Sbrk_Memory_Pool_Options
36 * @brief Helper class for Sbrk Memory Pool constructor options.
38 * This should be a nested class, but that breaks too many
39 * compilers.
41 class ACE_Export ACE_Sbrk_Memory_Pool_Options
45 /**
46 * @class ACE_Sbrk_Memory_Pool
48 * @brief Make a memory pool that is based on <sbrk(2)>.
50 class ACE_Export ACE_Sbrk_Memory_Pool
52 public:
53 typedef ACE_Sbrk_Memory_Pool_Options OPTIONS;
55 /// Initialize the pool.
56 ACE_Sbrk_Memory_Pool (const ACE_TCHAR *backing_store_name = 0,
57 const OPTIONS *options = 0);
59 virtual ~ACE_Sbrk_Memory_Pool (void);
61 // = Implementor operations.
62 /// Ask system for initial chunk of local memory.
63 virtual void *init_acquire (size_t nbytes,
64 size_t &rounded_bytes,
65 int &first_time);
67 /// Acquire at least @a nbytes from the memory pool. @a rounded_bytes is
68 /// the actual number of bytes allocated.
69 virtual void *acquire (size_t nbytes,
70 size_t &rounded_bytes);
72 /// Instruct the memory pool to release all of its resources.
73 virtual int release (int destroy = 1);
75 /**
76 * Sync @a len bytes of the memory region to the backing store
77 * starting at @c this->base_addr_. If @a len == -1 then sync the
78 * whole region.
80 virtual int sync (ssize_t len = -1, int flags = MS_SYNC);
82 /// Sync @a len bytes of the memory region to the backing store
83 /// starting at @a addr.
84 virtual int sync (void *addr, size_t len, int flags = MS_SYNC);
86 /**
87 * Change the protection of the pages of the mapped region to @a prot
88 * starting at @c this->base_addr_ up to @a len bytes. If @a len == -1
89 * then change protection of all pages in the mapped region.
91 virtual int protect (ssize_t len = -1, int prot = PROT_RDWR);
93 /// Change the protection of the pages of the mapped region to @a prot
94 /// starting at @a addr up to @a len bytes.
95 virtual int protect (void *addr, size_t len, int prot = PROT_RDWR);
97 /// Dump the state of an object.
98 virtual void dump (void) const;
100 /// Return the base address of this memory pool, 0 if base_addr
101 /// never changes.
102 virtual void *base_addr (void) const;
104 /// Declare the dynamic allocation hooks.
105 ACE_ALLOC_HOOK_DECLARE;
107 protected:
108 /// Implement the algorithm for rounding up the request to an
109 /// appropriate chunksize.
110 virtual size_t round_up (size_t nbytes);
113 ACE_END_VERSIONED_NAMESPACE_DECL
115 #endif /* !ACE_LACKS_SBRK */
117 #include /**/ "ace/post.h"
118 #endif /* ACE_SBRK_MEMORY_POOL_H */