diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-01-23 14:36:10 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-01-23 14:36:10 +0100 |
commit | 66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0 (patch) | |
tree | bd6aca447179f8d2e586c12cb961d683552504be /cpp/src/slice2freeze | |
parent | Minor code style fixes (diff) | |
download | ice-66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0.tar.bz2 ice-66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0.tar.xz ice-66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0.zip |
Fix for ICE-4841 - added no copy option when creating input stream
Diffstat (limited to 'cpp/src/slice2freeze')
-rw-r--r-- | cpp/src/slice2freeze/Main.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp index a42d692297c..d16c8213653 100644 --- a/cpp/src/slice2freeze/Main.cpp +++ b/cpp/src/slice2freeze/Main.cpp @@ -360,14 +360,11 @@ writeCodecC(const TypePtr& type, const StringList& metaData, const string& name, << "const Ice::EncodingVersion& encoding)"; C << sb; C << nl << "IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);"; - C << nl << "IceInternal::BasicStream stream(instance.get(), encoding, true);"; + C << nl << "IceInternal::BasicStream stream(instance.get(), encoding, &bytes[0], &bytes[0] + bytes.size());"; if(type->usesClasses()) { C << nl << "stream.sliceObjects(false);"; } - C << nl << "stream.b.resize(bytes.size());"; - C << nl << "::memcpy(&stream.b[0], &bytes[0], bytes.size());"; - C << nl << "stream.i = stream.b.begin();"; if(encaps) { C << nl << "stream.startReadEncaps();"; @@ -754,11 +751,9 @@ writeDictWithIndicesC(const string& name, const string& absolute, const Dict& di else { C << nl << "IceInternal::InstancePtr __instance = IceInternal::getInstance(__communicator);"; - C << nl << "IceInternal::BasicStream __stream(__instance.get(), __encoding, true);"; + C << nl << "IceInternal::BasicStream __stream(__instance.get(), __encoding, "; + C << "&__bytes[0], &__bytes[0] + __bytes.size());"; - C << nl << "__stream.b.resize(__bytes.size());"; - C << nl << "::memcpy(&__stream.b[0], &__bytes[0], __bytes.size());"; - C << nl << "__stream.i = __stream.b.begin();"; writeMarshalUnmarshalCode(C, indexTypes[i].type, false, 0, "__index", false, indexTypes[i].metaData, 0, "__stream", false); } |