summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/ObjectStore.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-02-24 17:34:55 +0000
committerMarc Laukien <marc@zeroc.com>2005-02-24 17:34:55 +0000
commite4843a84aee34f87b6ddff1f60f3901fa5d8eed1 (patch)
tree4ee5698a05625634f56085806c1cb59b4960ed13 /cpp/src/Freeze/ObjectStore.cpp
parentAdded missing break statement (diff)
downloadice-e4843a84aee34f87b6ddff1f60f3901fa5d8eed1.tar.bz2
ice-e4843a84aee34f87b6ddff1f60f3901fa5d8eed1.tar.xz
ice-e4843a84aee34f87b6ddff1f60f3901fa5d8eed1.zip
various performance improvements
Diffstat (limited to 'cpp/src/Freeze/ObjectStore.cpp')
-rw-r--r--cpp/src/Freeze/ObjectStore.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/Freeze/ObjectStore.cpp b/cpp/src/Freeze/ObjectStore.cpp
index dfbe0de1651..a8cc39c9079 100644
--- a/cpp/src/Freeze/ObjectStore.cpp
+++ b/cpp/src/Freeze/ObjectStore.cpp
@@ -257,7 +257,7 @@ Freeze::ObjectStore::marshal(const Identity& ident, Key& bytes, const Communicat
IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
IceInternal::BasicStream stream(instance.get());
ident.__write(&stream);
- stream.b.copyToVector(bytes);
+ vector<Byte>(stream.b.begin(), stream.b.end()).swap(bytes);
}
void
@@ -265,7 +265,8 @@ Freeze::ObjectStore::unmarshal(Identity& ident, const Key& bytes, const Communic
{
IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
IceInternal::BasicStream stream(instance.get());
- stream.b.copyFromVector(bytes);
+ stream.b.resize(bytes.size());
+ memcpy(&stream.b[0], &bytes[0], bytes.size());
stream.i = stream.b.begin();
ident.__read(&stream);
}
@@ -279,7 +280,7 @@ Freeze::ObjectStore::marshal(const ObjectRecord& v, Value& bytes, const Communic
v.__write(&stream);
stream.writePendingObjects();
stream.endWriteEncaps();
- stream.b.copyToVector(bytes);
+ vector<Byte>(stream.b.begin(), stream.b.end()).swap(bytes);
}
void
@@ -288,7 +289,8 @@ Freeze::ObjectStore::unmarshal(ObjectRecord& v, const Value& bytes, const Commun
IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);
IceInternal::BasicStream stream(instance.get());
stream.sliceObjects(false);
- stream.b.copyFromVector(bytes);
+ stream.b.resize(bytes.size());
+ memcpy(&stream.b[0], &bytes[0], bytes.size());
stream.i = stream.b.begin();
stream.startReadEncaps();
v.__read(&stream);