diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 1999-07-28 16:30:26 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 1999-07-28 16:30:26 +0000 |
commit | 5d03a74ba2cf6db4ab1f4ef052fe809bb02362cd (patch) | |
tree | 151ee67dd9fa9cd61db6848147a4a73d5c559a4e /ace/Message_Block.cpp | |
parent | d5b5f21d559492ac470ae0e112126dfd17f8b7d1 (diff) | |
download | ATCD-5d03a74ba2cf6db4ab1f4ef052fe809bb02362cd.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Message_Block.cpp')
-rw-r--r-- | ace/Message_Block.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 87e4271b777..03e2eeecafd 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -4,7 +4,7 @@ #include "ace/Message_Block.h" #include "ace/Synch_T.h" -// #define ACE_ENABLE_TIMEPROBES +//#define ACE_ENABLE_TIMEPROBES #include "ace/Timeprobe.h" #if !defined (__ACE_INLINE__) @@ -26,7 +26,9 @@ static const char *ACE_MB_Timeprobe_Description[] = "Data_Block::ctor[1] - enter", "Data_Block::ctor[1] - leave", "Data_Block::ctor[2] - enter", - "Data_Block::ctor[2] - leave" + "Data_Block::ctor[2] - leave", + "Data_Block::clone - enter", + "Data_Block::clone - leave" }; enum @@ -38,7 +40,9 @@ enum ACE_DATA_BLOCK_CTOR1_ENTER, ACE_DATA_BLOCK_CTOR1_LEAVE, ACE_DATA_BLOCK_CTOR2_ENTER, - ACE_DATA_BLOCK_CTOR2_LEAVE + ACE_DATA_BLOCK_CTOR2_LEAVE, + ACE_DATA_BLOCK_CLONE_ENTER, + ACE_DATA_BLOCK_CLONE_LEAVE }; @@ -854,8 +858,11 @@ ACE_Message_Block::duplicate (const ACE_Message_Block *mb) } ACE_Data_Block * -ACE_Data_Block::clone (ACE_Message_Block::Message_Flags mask) const +ACE_Data_Block::clone (ACE_Message_Block::Message_Flags mask, + int copy_data) const { + ACE_FUNCTION_TIMEPROBE(ACE_DATA_BLOCK_CLONE_ENTER); + ACE_TRACE ("ACE_Data_Block::clone"); // You always want to clear this one to prevent memory leaks but you @@ -878,9 +885,12 @@ ACE_Data_Block::clone (ACE_Message_Block::Message_Flags mask) const 0); // Copy all of the payload memory into the new object. - ACE_OS::memcpy (nb->base_, - this->base_, - this->max_size_); + if (copy_data) + { + ACE_OS::memcpy (nb->base_, + this->base_, + this->max_size_); + } // Set new flags minus the mask... nb->clr_flags (mask | always_clear); |