From 17b31a8b05f922c0eb0f2bdd4ad7dee8f111c21a Mon Sep 17 00:00:00 2001 From: jxh Date: Mon, 12 Oct 1998 18:23:10 +0000 Subject: * Asynch_IO.cpp: Minor changes to deal with FMR error. * Message_Block.{cpp,i,h}: Changed rd_ptr_ and wr_ptr_ to be byte offsets from base (). This allows one to resize a duplicate without trashing other Message_Blocks that may be referring to the same data block. * Proactor.cpp: Made the message block 64 bytes bigger to make purify happier. --- ace/Message_Block.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'ace/Message_Block.cpp') diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 27e2fd95aee..1c0f00bf4c4 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -199,18 +199,6 @@ ACE_Message_Block::size (size_t length) if (this->data_block ()->size (length) == -1) return -1; - // Reset the read and write pointers if we've changed the underlying - // memory buffer. - else if (this->data_block ()->base () != old_base) - { - // Compute the old deltas... - int r_delta = this->rd_ptr_ - old_base; - int w_delta = this->wr_ptr_ - old_base; - - // ... and use them to initialize the new deltas. - this->rd_ptr_ = this->data_block ()->base () + r_delta; - this->wr_ptr_ = this->data_block ()->base () + w_delta; - } return 0; } @@ -711,8 +699,8 @@ ACE_Message_Block::duplicate (void) const // same relative offset as in the existing . Note // that we are assuming that the data_block()->base() pointer // doesn't change when it's duplicated. - nb->rd_ptr (this->rd_ptr_ - this->data_block ()->base ()); - nb->wr_ptr (this->wr_ptr_ - this->data_block ()->base ()); + nb->rd_ptr (this->rd_ptr_); + nb->wr_ptr (this->wr_ptr_); // Increment the reference counts of all the continuation messages. if (this->cont_) @@ -807,8 +795,8 @@ ACE_Message_Block::clone (Message_Flags mask) const // Set the read and write pointers in the new to the // same relative offset as in the existing . - nb->rd_ptr (this->rd_ptr_ - this->data_block ()->base ()); - nb->wr_ptr (this->wr_ptr_ - this->data_block ()->base ()); + nb->rd_ptr (this->rd_ptr_); + nb->wr_ptr (this->wr_ptr_); // Clone all the continuation messages if necessary. if (this->cont () != 0 -- cgit v1.2.1