00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACE_SBRK_MEMORY_POOL_H
00015 #define ACE_SBRK_MEMORY_POOL_H
00016
00017 #include "ace/pre.h"
00018
00019 #include "ace/ACE_export.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif
00024
00025 #if !defined (ACE_LACKS_SBRK)
00026
00027 #include "ace/ACE.h"
00028 #include "ace/os_include/sys/os_mman.h"
00029
00030
00031 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class ACE_Export ACE_Sbrk_Memory_Pool_Options
00042 {
00043 };
00044
00045
00046
00047
00048
00049
00050 class ACE_Export ACE_Sbrk_Memory_Pool
00051 {
00052 public:
00053 typedef ACE_Sbrk_Memory_Pool_Options OPTIONS;
00054
00055
00056 ACE_Sbrk_Memory_Pool (const ACE_TCHAR *backing_store_name = 0,
00057 const OPTIONS *options = 0);
00058
00059 virtual ~ACE_Sbrk_Memory_Pool (void);
00060
00061
00062
00063 virtual void *init_acquire (size_t nbytes,
00064 size_t &rounded_bytes,
00065 int &first_time);
00066
00067
00068
00069 virtual void *acquire (size_t nbytes,
00070 size_t &rounded_bytes);
00071
00072
00073 virtual int release (int destroy = 1);
00074
00075
00076
00077
00078
00079
00080 virtual int sync (ssize_t len = -1, int flags = MS_SYNC);
00081
00082
00083
00084 virtual int sync (void *addr, size_t len, int flags = MS_SYNC);
00085
00086
00087
00088
00089
00090
00091 virtual int protect (ssize_t len = -1, int prot = PROT_RDWR);
00092
00093
00094
00095 virtual int protect (void *addr, size_t len, int prot = PROT_RDWR);
00096
00097
00098 virtual void dump (void) const;
00099
00100
00101
00102 virtual void *base_addr (void) const;
00103
00104
00105 ACE_ALLOC_HOOK_DECLARE;
00106
00107 protected:
00108
00109
00110 virtual size_t round_up (size_t nbytes);
00111 };
00112
00113 ACE_END_VERSIONED_NAMESPACE_DECL
00114
00115 #endif
00116
00117 #include "ace/post.h"
00118 #endif