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
)
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
,
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
,
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.
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.
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.
73 ACE_Shared_Memory_MM::close ()
75 ACE_TRACE ("ACE_Shared_Memory_MM::close");
76 return shared_memory_
.unmap ();
80 ACE_Shared_Memory_MM::malloc (size_t)
82 ACE_TRACE ("ACE_Shared_Memory_MM::malloc");
85 return this->shared_memory_ (addr
) == -1 ? 0 : addr
;
89 ACE_Shared_Memory_MM::get_id () const
91 ACE_TRACE ("ACE_Shared_Memory_MM::get_id");
92 return this->shared_memory_
.handle ();
96 ACE_Shared_Memory_MM::free (void *p
)
98 ACE_TRACE ("ACE_Shared_Memory_MM::free");
102 ACE_END_VERSIONED_NAMESPACE_DECL