GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / Shared_Memory_SV.cpp
blob1a7e10b401da20b2086e36649d63b28ffa0c2904
1 #include "ace/Shared_Memory_SV.h"
3 #if !defined (__ACE_INLINE__)
4 #include "ace/Shared_Memory_SV.inl"
5 #endif /* __ACE_INLINE__ */
7 #if defined (ACE_HAS_ALLOC_HOOKS)
8 # include "ace/Malloc_Base.h"
9 #endif /* ACE_HAS_ALLOC_HOOKS */
11 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
13 ACE_ALLOC_HOOK_DEFINE(ACE_Shared_Memory_SV)
15 void
16 ACE_Shared_Memory_SV::dump (void) const
18 #if defined (ACE_HAS_DUMP)
19 ACE_TRACE ("ACE_Shared_Memory_SV::dump");
20 #endif /* ACE_HAS_DUMP */
23 ACE_Shared_Memory_SV::ACE_Shared_Memory_SV (key_t id,
24 size_t length,
25 int create,
26 int perms,
27 void *addr,
28 int flags)
29 : shared_memory_ (id, length, create, perms, addr, flags)
31 ACE_TRACE ("ACE_Shared_Memory_SV::ACE_Shared_Memory_SV");
34 // The overall size of the segment.
36 size_t
37 ACE_Shared_Memory_SV::get_segment_size (void) const
39 ACE_TRACE ("ACE_Shared_Memory_SV::get_segment_size");
40 // This cast is ok since the 'open' method for this class allows only
41 // an 'int' size. Therefore, this case should not lose information.
42 return this->shared_memory_.get_segment_size ();
45 // Removes the shared memory segment.
47 int
48 ACE_Shared_Memory_SV::remove (void)
50 ACE_TRACE ("ACE_Shared_Memory_SV::remove");
51 return shared_memory_.remove ();
54 // Closes (detaches) the shared memory segment.
56 int
57 ACE_Shared_Memory_SV::close (void)
59 ACE_TRACE ("ACE_Shared_Memory_SV::close");
60 return shared_memory_.detach ();
63 void *
64 ACE_Shared_Memory_SV::malloc (size_t)
66 ACE_TRACE ("ACE_Shared_Memory_SV::malloc");
67 return this->shared_memory_.get_segment_ptr ();
70 ACE_HANDLE
71 ACE_Shared_Memory_SV::get_id (void) const
73 ACE_TRACE ("ACE_Shared_Memory_SV::get_id");
74 return this->shared_memory_.get_id ();
77 int
78 ACE_Shared_Memory_SV::free (void *p)
80 ACE_TRACE ("ACE_Shared_Memory_SV::free");
81 return p != 0;
84 ACE_END_VERSIONED_NAMESPACE_DECL