aboutsummaryrefslogtreecommitdiff
path: root/zencore/compactbinarypackage.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-13 12:01:18 +0200
committerStefan Boberg <[email protected]>2021-05-13 12:01:18 +0200
commit0b8280d4fcbf3a65997c3cc86cf14f5f7c44b7fe (patch)
tree5ce29b79d0636e8e127c68c9fb9928b67759d1ac /zencore/compactbinarypackage.cpp
parentclang-format (diff)
downloadzen-0b8280d4fcbf3a65997c3cc86cf14f5f7c44b7fe.tar.xz
zen-0b8280d4fcbf3a65997c3cc86cf14f5f7c44b7fe.zip
Made SharedBuffer/UniqueBuffer share guts with IoBuffer
This enables way more efficient marshaling of compact binary objects and attachments
Diffstat (limited to 'zencore/compactbinarypackage.cpp')
-rw-r--r--zencore/compactbinarypackage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/zencore/compactbinarypackage.cpp b/zencore/compactbinarypackage.cpp
index 9eb67ac93..f84137ff6 100644
--- a/zencore/compactbinarypackage.cpp
+++ b/zencore/compactbinarypackage.cpp
@@ -145,7 +145,7 @@ CbAttachment::Load(BinaryReader& Reader, BufferAllocator Allocator)
std::vector<uint8_t> HashBuffer;
CbField HashField = LoadCompactBinary(Reader, [&HashBuffer](uint64_t Size) -> UniqueBuffer {
HashBuffer.resize(Size);
- return UniqueBuffer::MakeView(HashBuffer.data(), Size);
+ return UniqueBuffer::MakeMutableView(HashBuffer.data(), Size);
});
Hash = HashField.AsAttachment();
ZEN_ASSERT(!HashField.HasError(), "Attachments must be a non-empty binary value with a content hash.");
@@ -351,7 +351,7 @@ CbPackage::Load(BinaryReader& Reader, BufferAllocator Allocator, AttachmentResol
const auto StackAllocator = [&Allocator, &StackBuffer](uint64_t Size) -> UniqueBuffer {
if (Size <= sizeof(StackBuffer))
{
- return UniqueBuffer::MakeView(StackBuffer, Size);
+ return UniqueBuffer::MakeMutableView(StackBuffer, Size);
}
return Allocator(Size);