1 #ifndef ACE_MESSAGE_BLOCK_T_CPP
2 #define ACE_MESSAGE_BLOCK_T_CPP
4 #include "ace/Malloc_Base.h" /* Need ACE_Allocator */
6 #if !defined (__ACE_INLINE__)
7 #include "ace/Message_Block_T.inl"
8 #endif /* __ACE_INLINE__ */
10 #include "ace/os_include/os_errno.h"
12 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 ACE_Locked_Data_Block
<L
>::~ACE_Locked_Data_Block (void)
19 template<class ACE_LOCK
> ACE_Data_Block
*
20 ACE_Locked_Data_Block
<ACE_LOCK
>::clone_nocopy (ACE_Message_Block::Message_Flags mask
,
21 size_t max_size
) const
23 ACE_TRACE ("ACE_Locked_Data_Block::clone_nocopy");
25 // You always want to clear this one to prevent memory leaks but you
26 // might add some others later.
27 const ACE_Message_Block::Message_Flags always_clear
=
28 ACE_Message_Block::DONT_DELETE
;
30 ACE_Locked_Data_Block
<ACE_LOCK
> *nb
= 0;
32 ACE_NEW_MALLOC_RETURN (nb
,
33 static_cast<ACE_Locked_Data_Block
<ACE_LOCK
>*> (
34 this->data_block_allocator ()->malloc (sizeof (ACE_Locked_Data_Block
<ACE_LOCK
>))),
35 ACE_Locked_Data_Block
<ACE_LOCK
> (
37 this->size () : max_size
,
40 this->allocator_strategy (),
42 this->data_block_allocator ()),
45 // Set new flags minus the mask...
46 nb
->clr_flags (mask
| always_clear
);
50 ACE_END_VERSIONED_NAMESPACE_DECL
52 #endif /* ACE_MESSAGE_BLOCK_T_CPP */