diff options
| author | Stefan Boberg <[email protected]> | 2025-03-06 17:27:59 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2025-03-06 17:27:59 +0100 |
| commit | 66e5d1f4e288e0c32f854ebe3b63584b42b83554 (patch) | |
| tree | d67e9d358419b5baccd429d54988414e0d7cd7a6 /src/zenhttp/packageformat.cpp | |
| parent | reduced memory churn using fixed_xxx containers (#236) (diff) | |
| download | zen-66e5d1f4e288e0c32f854ebe3b63584b42b83554.tar.xz zen-66e5d1f4e288e0c32f854ebe3b63584b42b83554.zip | |
switched std::vector -> eastl::vector
Diffstat (limited to 'src/zenhttp/packageformat.cpp')
| -rw-r--r-- | src/zenhttp/packageformat.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/zenhttp/packageformat.cpp b/src/zenhttp/packageformat.cpp index ae80851e4..b772ba2cf 100644 --- a/src/zenhttp/packageformat.cpp +++ b/src/zenhttp/packageformat.cpp @@ -16,8 +16,8 @@ #include <zencore/testutils.h> #include <zencore/trace.h> +#include <EASTL/vector.h> #include <span> -#include <vector> #include <EASTL/fixed_vector.h> @@ -37,7 +37,7 @@ typedef eastl::fixed_vector<IoBuffer, 16> IoBufferVec_t; IoBufferVec_t FormatPackageMessageInternal(const CbPackage& Data, FormatFlags Flags, void* TargetProcessHandle); -std::vector<IoBuffer> +eastl::vector<IoBuffer> FormatPackageMessage(const CbPackage& Data, void* TargetProcessHandle) { return FormatPackageMessage(Data, FormatFlags::kDefault, TargetProcessHandle); @@ -48,11 +48,11 @@ FormatPackageMessageBuffer(const CbPackage& Data, void* TargetProcessHandle) return FormatPackageMessageBuffer(Data, FormatFlags::kDefault, TargetProcessHandle); } -std::vector<IoBuffer> +eastl::vector<IoBuffer> FormatPackageMessage(const CbPackage& Data, FormatFlags Flags, void* TargetProcessHandle) { auto Vec = FormatPackageMessageInternal(Data, Flags, TargetProcessHandle); - return std::vector<IoBuffer>(begin(Vec), end(Vec)); + return eastl::vector<IoBuffer>(begin(Vec), end(Vec)); } CompositeBuffer @@ -85,7 +85,7 @@ MarshalLocal(CbAttachmentEntry*& AttachmentInfo, static bool IsLocalRef(tsl::robin_map<void*, std::string>& FileNameMap, - std::vector<void*>& DuplicatedHandles, + eastl::vector<void*>& DuplicatedHandles, const CompositeBuffer& AttachmentBinary, bool DenyPartialLocalReferences, void* TargetProcessHandle, @@ -165,7 +165,7 @@ FormatPackageMessageInternal(const CbPackage& Data, FormatFlags Flags, void* Tar { ZEN_TRACE_CPU("FormatPackageMessage"); - std::vector<void*> DuplicatedHandles; + eastl::vector<void*> DuplicatedHandles; #if ZEN_PLATFORM_WINDOWS auto _ = MakeGuard([&DuplicatedHandles, &TargetProcessHandle]() { if (TargetProcessHandle == nullptr) @@ -394,12 +394,12 @@ ParsePackageMessage(IoBuffer Payload, std::function<IoBuffer(const IoHash&, uint CbPackage Package; - std::vector<CbAttachment> Attachments; + eastl::vector<CbAttachment> Attachments; Attachments.reserve(ChunkCount); // Guessing here... tsl::robin_map<std::string, IoBuffer> PartialFileBuffers; - std::vector<std::pair<uint32_t, std::string>> MalformedAttachments; + eastl::vector<std::pair<uint32_t, std::string>> MalformedAttachments; for (uint32_t i = 0; i < ChunkCount; ++i) { @@ -830,7 +830,7 @@ TEST_CASE("CbPackage.EmptyObject") { CbPackage Pkg; Pkg.SetObject({}); - std::vector<IoBuffer> Result = FormatPackageMessage(Pkg, nullptr); + eastl::vector<IoBuffer> Result = FormatPackageMessage(Pkg, nullptr); } TEST_CASE("CbPackage.LocalRef") |