summaryrefslogtreecommitdiff
path: root/TAO/tao/Sequence.i
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Sequence.i')
-rw-r--r--TAO/tao/Sequence.i36
1 files changed, 1 insertions, 35 deletions
diff --git a/TAO/tao/Sequence.i b/TAO/tao/Sequence.i
index b8de5ad0e10..bd1078e1deb 100644
--- a/TAO/tao/Sequence.i
+++ b/TAO/tao/Sequence.i
@@ -354,41 +354,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::replace (CORBA::ULong length,
const ACE_Message_Block* mb)
{
this->_deallocate_buffer ();
-
- // Get the message block flags.
- ACE_Message_Block::Message_Flags flg = mb->self_flags ();
-
- // If the DONT_DELETE flag is disabled just a duplicate would
- // help. If the DONT_DELETE flag is enabled a deep copy is needed as
- // the contents would be on stack. Just incrementing the ref count
- // on the stack based data block would only crash the program when
- // the stack unwinds
- if (ACE_BIT_DISABLED (flg,
- ACE_Message_Block::DONT_DELETE))
- {
- this->mb_ = ACE_Message_Block::duplicate (mb);
- }
- else
- {
- // As we are in CORBA mode, all the data blocks would be aligned
- // on an 8 byte boundary
- ACE_Message_Block msgb (*mb,
- ACE_CDR::MAX_ALIGNMENT);
-
- // Get the base pointer of the incoming message block
- char *start = ACE_ptr_align_binary (mb->base (),
- ACE_CDR::MAX_ALIGNMENT);
-
- // Get the read and write displacements in the incoming stream
- size_t rd_pos = mb->rd_ptr () - start;
- size_t wr_pos = mb->wr_ptr () - start;
-
- this->mb_ = ACE_Message_Block::duplicate (&msgb);
-
- this->mb_->rd_ptr (rd_pos);
- this->mb_->wr_ptr (wr_pos);
- }
-
+ this->mb_ = ACE_Message_Block::duplicate (mb);
this->buffer_ = this->mb_->rd_ptr ();
this->maximum_ = length;
this->length_ = length;