Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Shared_Memory_MM.cpp
blob2b255a38a5ef7f8a517b06477b84d799b662b370
1 #include "ace/Shared_Memory_MM.h"
3 #if defined (ACE_HAS_ALLOC_HOOKS)
4 # include "ace/Malloc_Base.h"
5 #endif /* ACE_HAS_ALLOC_HOOKS */
7 #if !defined (__ACE_INLINE__)
8 #include "ace/Shared_Memory_MM.inl"
9 #endif /* __ACE_INLINE__ */
11 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
13 ACE_ALLOC_HOOK_DEFINE(ACE_Shared_Memory_MM)
15 void
16 ACE_Shared_Memory_MM::dump () const
18 #if defined (ACE_HAS_DUMP)
19 ACE_TRACE ("ACE_Shared_Memory_MM::dump");
20 #endif /* ACE_HAS_DUMP */
23 /// Creates a shared memory segment of SIZE bytes.
24 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (ACE_HANDLE handle,
25 size_t length,
26 int prot,
27 int share,
28 char *addr,
29 ACE_OFF_T pos)
30 : shared_memory_ (handle, length, prot, share, addr, pos)
32 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
35 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (const ACE_TCHAR *file_name,
36 size_t len,
37 int flags,
38 int mode,
39 int prot,
40 int share,
41 char *addr,
42 ACE_OFF_T pos)
43 : shared_memory_ (file_name, len, flags, mode,
44 prot, share, addr, pos)
46 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
49 /// The "do-nothing" constructor.
50 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM ()
52 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
55 /// The overall size of the segment.
56 size_t
57 ACE_Shared_Memory_MM::get_segment_size () const
59 ACE_TRACE ("ACE_Shared_Memory_MM::get_segment_size");
60 return this->shared_memory_.size ();
63 /// Unmaps the shared memory segment.
64 int
65 ACE_Shared_Memory_MM::remove ()
67 ACE_TRACE ("ACE_Shared_Memory_MM::remove");
68 return shared_memory_.remove ();
71 /// Closes (unmaps) the shared memory segment.
72 int
73 ACE_Shared_Memory_MM::close ()
75 ACE_TRACE ("ACE_Shared_Memory_MM::close");
76 return shared_memory_.unmap ();
79 void *
80 ACE_Shared_Memory_MM::malloc (size_t)
82 ACE_TRACE ("ACE_Shared_Memory_MM::malloc");
83 void *addr = 0;
85 return this->shared_memory_ (addr) == -1 ? 0 : addr;
88 ACE_HANDLE
89 ACE_Shared_Memory_MM::get_id () const
91 ACE_TRACE ("ACE_Shared_Memory_MM::get_id");
92 return this->shared_memory_.handle ();
95 int
96 ACE_Shared_Memory_MM::free (void *p)
98 ACE_TRACE ("ACE_Shared_Memory_MM::free");
99 return p != 0;
102 ACE_END_VERSIONED_NAMESPACE_DECL