summaryrefslogtreecommitdiff
path: root/TAO/tao/Generic_Sequence_T.h
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-02-18 11:15:38 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-02-18 11:15:38 +0000
commitea00faaeed1483c3f1fa3dc73acbf63486674645 (patch)
tree39190438815731d6b05ca03e6fb4da3c797ffbf6 /TAO/tao/Generic_Sequence_T.h
parenta96c4e6cdcb0b366ce4b26b1a8a7e148e4c5ada7 (diff)
downloadATCD-ea00faaeed1483c3f1fa3dc73acbf63486674645.tar.gz
ChangeLogTag: Wed Feb 18 10:37:15 UTC 2009 Vladimir Zykov <vz@prismtech.com>
Diffstat (limited to 'TAO/tao/Generic_Sequence_T.h')
-rw-r--r--TAO/tao/Generic_Sequence_T.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/TAO/tao/Generic_Sequence_T.h b/TAO/tao/Generic_Sequence_T.h
index e56f2948384..4d03794d853 100644
--- a/TAO/tao/Generic_Sequence_T.h
+++ b/TAO/tao/Generic_Sequence_T.h
@@ -117,8 +117,9 @@ public:
, release_(false)
{
if (rhs.maximum_ == 0) return;
- generic_sequence tmp(rhs.maximum_);
- tmp.length_ = rhs.length_;
+ generic_sequence tmp(rhs.maximum_, rhs.length_,
+ allocation_traits::allocbuf_noinit(rhs.length_),
+ true);
element_traits::copy_range(
rhs.buffer_,
rhs.buffer_ + rhs.length_,
@@ -164,12 +165,16 @@ public:
/// Set a new length for the sequence
void length(CORBA::ULong length)
{
- if (length <= maximum_ || length <= length_)
+ if (length <= maximum_)
{
if (buffer_ == 0)
{
buffer_ = allocbuf(maximum_);
release_ = true;
+ length_ = length;
+ // Since allocbuf returns completely initialized buffer
+ // no further actions are required.
+ return;
}
if (length < length_)
@@ -190,9 +195,10 @@ public:
return;
}
- generic_sequence tmp(length);
- tmp.length_ = length;
- element_traits::copy_range(
+ generic_sequence tmp(length, length,
+ allocation_traits::allocbuf_noinit(length),
+ true);
+ element_traits::copy_swap_range(
buffer_,
buffer_ + length_,
ACE_make_checked_array_iterator (tmp.buffer_, tmp.length_));