diff options
author | Jose <jose@zeroc.com> | 2019-03-09 00:04:10 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-03-09 00:04:10 +0100 |
commit | 3216f7ccb5db99204523a1dd9f2ff09b49fbac35 (patch) | |
tree | ba439fc2a90e862a17a55a089c19a8b13379e69a /swift/src | |
parent | Marshalling fixes (diff) | |
download | ice-3216f7ccb5db99204523a1dd9f2ff09b49fbac35.tar.bz2 ice-3216f7ccb5db99204523a1dd9f2ff09b49fbac35.tar.xz ice-3216f7ccb5db99204523a1dd9f2ff09b49fbac35.zip |
Value marshalling fixes
Diffstat (limited to 'swift/src')
-rw-r--r-- | swift/src/Ice/OutputStream.swift | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/swift/src/Ice/OutputStream.swift b/swift/src/Ice/OutputStream.swift index 448fdbe58a8..4c41acdd96a 100644 --- a/swift/src/Ice/OutputStream.swift +++ b/swift/src/Ice/OutputStream.swift @@ -156,6 +156,16 @@ public class OutputStream { // Create a copy return Array(UnsafeRawBufferPointer(start: buf.baseAddress!, count: buf.size)) } + + public func startSlice(typeId: String, compactId: Int32, last: Bool) { + precondition(encapsStack != nil && encapsStack.encoder != nil) + encapsStack.encoder.startSlice(typeId: typeId, compactId: compactId, last: last) + } + + public func endSlice() { + precondition(encapsStack != nil && encapsStack.encoder != nil) + encapsStack.encoder.endSlice() + } } public extension OutputStream { @@ -568,14 +578,15 @@ private enum SliceType { private struct ValueHolder: Hashable { let value: Value - var hashValue: Int { - return ObjectIdentifier(value).hashValue - } init(_ value: Value) { self.value = value } + func hash(into hasher: inout Hasher) { + hasher.combine(ObjectIdentifier(value).hashValue) + } + static func == (lhs: ValueHolder, rhs: ValueHolder) -> Bool { return ObjectIdentifier(lhs.value) == ObjectIdentifier(rhs.value) } |