diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-07-17 14:42:07 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-07-17 14:42:07 +0000 |
commit | e16de8c8c2f4d0a6eb44160dc887fe875c83bb7f (patch) | |
tree | 8d4caf5c22cd4c69e8a455cb79683d909be7122c /TAO/tao/PortableServer/POA_Current_Impl.inl | |
parent | b6b6f7e828f346ac0c38b363fafe25f0a8e0532a (diff) | |
download | ATCD-e16de8c8c2f4d0a6eb44160dc887fe875c83bb7f.tar.gz |
ChangeLogTag: Mon Jul 17 14:40:43 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tao/PortableServer/POA_Current_Impl.inl')
-rw-r--r-- | TAO/tao/PortableServer/POA_Current_Impl.inl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/TAO/tao/PortableServer/POA_Current_Impl.inl b/TAO/tao/PortableServer/POA_Current_Impl.inl index db220558ae6..cf3fee49d65 100644 --- a/TAO/tao/PortableServer/POA_Current_Impl.inl +++ b/TAO/tao/PortableServer/POA_Current_Impl.inl @@ -25,7 +25,22 @@ namespace TAO ACE_INLINE void POA_Current_Impl::object_id (const PortableServer::ObjectId &id) { - this->object_id_ = id; + if (this->object_id_.release () || + this->object_id_.get_buffer() == this->object_id_buf_) + { + // Resize the current object_id_. If it is less than the + // length of the current buffer, no allocation will take place. + size_t id_size = id.length (); + this->object_id_.length (id_size); + + // Get the buffer and copy the new object id in it's place. + ACE_OS::memcpy (this->object_id_.get_buffer (), + id.get_buffer (), id_size); + } + else + { + this->object_id_ = id; + } } ACE_INLINE const PortableServer::ObjectId & @@ -38,6 +53,8 @@ namespace TAO POA_Current_Impl::replace_object_id ( const PortableServer::ObjectId &system_id) { + // This has the effect of replacing the underlying buffer + // with that of another object id without copying. object_id_.replace (system_id.maximum (), system_id.length (), const_cast <CORBA::Octet *> (system_id.get_buffer ()), |