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 (void) 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.
25 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (ACE_HANDLE handle
,
31 : shared_memory_ (handle
, length
, prot
, share
, addr
, pos
)
33 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
36 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (const ACE_TCHAR
*file_name
,
44 : shared_memory_ (file_name
, len
, flags
, mode
,
45 prot
, share
, addr
, pos
)
47 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
50 // The "do-nothing" constructor.
52 ACE_Shared_Memory_MM::ACE_Shared_Memory_MM (void)
54 ACE_TRACE ("ACE_Shared_Memory_MM::ACE_Shared_Memory_MM");
57 // The overall size of the segment.
60 ACE_Shared_Memory_MM::get_segment_size (void) const
62 ACE_TRACE ("ACE_Shared_Memory_MM::get_segment_size");
63 // This cast is legit since the original length in open() is an int.
64 return this->shared_memory_
.size ();
67 // Unmaps the shared memory segment.
70 ACE_Shared_Memory_MM::remove (void)
72 ACE_TRACE ("ACE_Shared_Memory_MM::remove");
73 return shared_memory_
.remove ();
76 // Closes (unmaps) the shared memory segment.
79 ACE_Shared_Memory_MM::close (void)
81 ACE_TRACE ("ACE_Shared_Memory_MM::close");
82 return shared_memory_
.unmap ();
86 ACE_Shared_Memory_MM::malloc (size_t)
88 ACE_TRACE ("ACE_Shared_Memory_MM::malloc");
91 return this->shared_memory_ (addr
) == -1 ? 0 : addr
;
95 ACE_Shared_Memory_MM::get_id (void) const
97 ACE_TRACE ("ACE_Shared_Memory_MM::get_id");
98 return this->shared_memory_
.handle ();
102 ACE_Shared_Memory_MM::free (void *p
)
104 ACE_TRACE ("ACE_Shared_Memory_MM::free");
108 ACE_END_VERSIONED_NAMESPACE_DECL