aboutsummaryrefslogtreecommitdiff
path: root/src/zencore
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore')
-rw-r--r--src/zencore/compactbinarypackage.cpp2
-rw-r--r--src/zencore/compress.cpp142
-rw-r--r--src/zencore/include/zencore/compactbinarypackage.h8
-rw-r--r--src/zencore/include/zencore/compositebuffer.h10
-rw-r--r--src/zencore/include/zencore/memoryview.h6
-rw-r--r--src/zencore/include/zencore/sharedbuffer.h2
-rw-r--r--src/zencore/include/zencore/string.h19
-rw-r--r--src/zencore/jobqueue.cpp2
-rw-r--r--src/zencore/memtrack/callstacktrace.cpp10
-rw-r--r--src/zencore/string.cpp16
10 files changed, 108 insertions, 109 deletions
diff --git a/src/zencore/compactbinarypackage.cpp b/src/zencore/compactbinarypackage.cpp
index ffe64f2e9..91fcc75f3 100644
--- a/src/zencore/compactbinarypackage.cpp
+++ b/src/zencore/compactbinarypackage.cpp
@@ -373,7 +373,7 @@ CbPackage::AddAttachment(const CbAttachment& Attachment, AttachmentResolver* Res
}
void
-CbPackage::AddAttachments(std::span<const CbAttachment> InAttachments)
+CbPackage::AddAttachments(eastl::span<const CbAttachment> InAttachments)
{
if (InAttachments.empty())
{
diff --git a/src/zencore/compress.cpp b/src/zencore/compress.cpp
index bc9ce0c30..2c2ff87de 100644
--- a/src/zencore/compress.cpp
+++ b/src/zencore/compress.cpp
@@ -755,7 +755,7 @@ BlockDecoder::DecompressToStream(const BufferHeader& Header,
UniqueBuffer BlockSizeBuffer;
MemoryView BlockSizeView = CompressedData.ViewOrCopyRange(sizeof(BufferHeader), Header.BlockCount * sizeof(uint32_t), BlockSizeBuffer);
- std::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
+ eastl::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
UniqueBuffer CompressedBlockCopy;
@@ -891,7 +891,7 @@ BlockDecoder::TryDecompressTo(const BufferHeader& Header,
UniqueBuffer BlockSizeBuffer;
MemoryView BlockSizeView = CompressedData.ViewOrCopyRange(sizeof(BufferHeader), Header.BlockCount * sizeof(uint32_t), BlockSizeBuffer);
- std::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
+ eastl::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
UniqueBuffer CompressedBlockCopy;
UniqueBuffer UncompressedBlockCopy;
@@ -1569,8 +1569,8 @@ GetCompressedRange(const BufferHeader& Header,
}
else
{
- MemoryView BlockSizeView = HeaderRawData.Mid(sizeof(Header), Header.BlockCount * sizeof(uint32_t));
- std::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
+ MemoryView BlockSizeView = HeaderRawData.Mid(sizeof(Header), Header.BlockCount * sizeof(uint32_t));
+ eastl::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
const uint64_t BlockSize = uint64_t(1) << Header.BlockSizeExponent;
const uint64_t LastBlockSize = BlockSize - ((Header.BlockCount * BlockSize) - Header.TotalRawSize);
@@ -1657,8 +1657,8 @@ CopyCompressedRange(const BufferHeader& Header,
}
else
{
- MemoryView BlockSizeView = HeaderRawData.Mid(sizeof(Header), Header.BlockCount * sizeof(uint32_t));
- std::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
+ MemoryView BlockSizeView = HeaderRawData.Mid(sizeof(Header), Header.BlockCount * sizeof(uint32_t));
+ eastl::span<uint32_t const> CompressedBlockSizes(reinterpret_cast<const uint32_t*>(BlockSizeView.GetData()), Header.BlockCount);
const uint64_t BlockSize = uint64_t(1) << Header.BlockSizeExponent;
const uint64_t LastBlockSize = BlockSize - ((Header.BlockCount * BlockSize) - Header.TotalRawSize);
@@ -2369,7 +2369,7 @@ TEST_CASE("CompressedBuffer")
return Data;
};
- auto ValidateData = [](std::span<uint64_t const> Values, std::span<uint64_t const> ExpectedValues, uint64_t Offset) {
+ auto ValidateData = [](eastl::span<uint64_t const> Values, eastl::span<uint64_t const> ExpectedValues, uint64_t Offset) {
for (size_t Idx = Offset; uint64_t Value : Values)
{
const uint64_t ExpectedValue = ExpectedValues[Idx++];
@@ -2385,7 +2385,7 @@ TEST_CASE("CompressedBuffer")
const eastl::vector<uint64_t>& ExpectedValues) {
SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
CHECK(Uncompressed.GetSize() == Count * sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
ValidateData(Values, ExpectedValues, OffsetCount);
};
@@ -2409,32 +2409,32 @@ TEST_CASE("CompressedBuffer")
SUBCASE("decompress with offset only")
{
- const uint64_t BlockSize = 64 * sizeof(uint64_t);
- const uint64_t N = 1000;
- eastl::vector<uint64_t> ExpectedValues = GenerateData(N);
- CompressedBuffer Compressed = CompressedBuffer::Compress(SharedBuffer::MakeView(MakeMemoryView(ExpectedValues)),
- OodleCompressor::Mermaid,
- OodleCompressionLevel::Optimal4,
- BlockSize);
- const uint64_t OffsetCount = 150;
- SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ const uint64_t BlockSize = 64 * sizeof(uint64_t);
+ const uint64_t N = 1000;
+ eastl::vector<uint64_t> ExpectedValues = GenerateData(N);
+ CompressedBuffer Compressed = CompressedBuffer::Compress(SharedBuffer::MakeView(MakeMemoryView(ExpectedValues)),
+ OodleCompressor::Mermaid,
+ OodleCompressionLevel::Optimal4,
+ BlockSize);
+ const uint64_t OffsetCount = 150;
+ SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
ValidateData(Values, ExpectedValues, OffsetCount);
}
SUBCASE("decompress buffer with one block")
{
- const uint64_t BlockSize = 256 * sizeof(uint64_t);
- const uint64_t N = 100;
- eastl::vector<uint64_t> ExpectedValues = GenerateData(N);
- CompressedBuffer Compressed = CompressedBuffer::Compress(SharedBuffer::MakeView(MakeMemoryView(ExpectedValues)),
- OodleCompressor::Mermaid,
- OodleCompressionLevel::Optimal4,
- BlockSize);
- const uint64_t OffsetCount = 2;
- const uint64_t Count = 50;
- SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ const uint64_t BlockSize = 256 * sizeof(uint64_t);
+ const uint64_t N = 100;
+ eastl::vector<uint64_t> ExpectedValues = GenerateData(N);
+ CompressedBuffer Compressed = CompressedBuffer::Compress(SharedBuffer::MakeView(MakeMemoryView(ExpectedValues)),
+ OodleCompressor::Mermaid,
+ OodleCompressionLevel::Optimal4,
+ BlockSize);
+ const uint64_t OffsetCount = 2;
+ const uint64_t Count = 50;
+ SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2446,18 +2446,18 @@ TEST_CASE("CompressedBuffer")
OodleCompressor::NotSet,
OodleCompressionLevel::None);
{
- const uint64_t OffsetCount = 0;
- const uint64_t Count = N;
- SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ const uint64_t OffsetCount = 0;
+ const uint64_t Count = N;
+ SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
ValidateData(Values, ExpectedValues, OffsetCount);
}
{
- const uint64_t OffsetCount = 21;
- const uint64_t Count = 999;
- SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ const uint64_t OffsetCount = 21;
+ const uint64_t Count = 999;
+ SharedBuffer Uncompressed = Compressed.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
ValidateData(Values, ExpectedValues, OffsetCount);
}
}
@@ -2477,7 +2477,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 0;
const uint64_t Count = N;
SharedBuffer Uncompressed = Compressed.CopyRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2486,7 +2486,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 64;
const uint64_t Count = N - 64;
SharedBuffer Uncompressed = Compressed.CopyRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2498,10 +2498,10 @@ TEST_CASE("CompressedBuffer")
const uint64_t RawSize = Count * sizeof(uint64_t);
uint64_t FirstBlockOffset = RawOffset % BlockSize;
- SharedBuffer Uncompressed = Compressed.CopyRange(RawOffset, RawSize).Decompress();
- std::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
- RawSize / sizeof(uint64_t));
+ SharedBuffer Uncompressed = Compressed.CopyRange(RawOffset, RawSize).Decompress();
+ eastl::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
+ RawSize / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2513,10 +2513,10 @@ TEST_CASE("CompressedBuffer")
const uint64_t RawSize = Count * sizeof(uint64_t);
uint64_t FirstBlockOffset = RawOffset % BlockSize;
- SharedBuffer Uncompressed = Compressed.CopyRange(RawOffset, RawSize).Decompress();
- std::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
- RawSize / sizeof(uint64_t));
+ SharedBuffer Uncompressed = Compressed.CopyRange(RawOffset, RawSize).Decompress();
+ eastl::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
+ RawSize / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2537,7 +2537,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 0;
const uint64_t Count = N;
SharedBuffer Uncompressed = Compressed.GetRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2546,7 +2546,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 64;
const uint64_t Count = N - 64;
SharedBuffer Uncompressed = Compressed.GetRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2558,10 +2558,10 @@ TEST_CASE("CompressedBuffer")
const uint64_t RawSize = Count * sizeof(uint64_t);
uint64_t FirstBlockOffset = RawOffset % BlockSize;
- SharedBuffer Uncompressed = Compressed.GetRange(RawOffset, RawSize).Decompress();
- std::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
- RawSize / sizeof(uint64_t));
+ SharedBuffer Uncompressed = Compressed.GetRange(RawOffset, RawSize).Decompress();
+ eastl::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
+ RawSize / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2573,10 +2573,10 @@ TEST_CASE("CompressedBuffer")
const uint64_t RawSize = Count * sizeof(uint64_t);
uint64_t FirstBlockOffset = RawOffset % BlockSize;
- SharedBuffer Uncompressed = Compressed.GetRange(RawOffset, RawSize).Decompress();
- std::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
- std::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
- RawSize / sizeof(uint64_t));
+ SharedBuffer Uncompressed = Compressed.GetRange(RawOffset, RawSize).Decompress();
+ eastl::span<uint64_t const> AllValues((const uint64_t*)Uncompressed.GetData(), RawSize / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)(((const uint8_t*)(Uncompressed.GetData()) + FirstBlockOffset)),
+ RawSize / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2595,7 +2595,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 0;
const uint64_t Count = N;
SharedBuffer Uncompressed = Compressed.CopyRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2604,7 +2604,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 1;
const uint64_t Count = N - OffsetCount;
SharedBuffer Uncompressed = Compressed.CopyRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2613,7 +2613,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 42;
const uint64_t Count = 100;
SharedBuffer Uncompressed = Compressed.CopyRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2632,7 +2632,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 0;
const uint64_t Count = N;
SharedBuffer Uncompressed = Compressed.GetRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2641,7 +2641,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 1;
const uint64_t Count = N - OffsetCount;
SharedBuffer Uncompressed = Compressed.GetRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2650,7 +2650,7 @@ TEST_CASE("CompressedBuffer")
const uint64_t OffsetCount = 42;
const uint64_t Count = 100;
SharedBuffer Uncompressed = Compressed.GetRange(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t)).Decompress();
- std::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
+ eastl::span<uint64_t const> Values((const uint64_t*)Uncompressed.GetData(), Uncompressed.GetSize() / sizeof(uint64_t));
CHECK(Values.size() == Count);
ValidateData(Values, ExpectedValues, OffsetCount);
}
@@ -2680,13 +2680,13 @@ TEST_CASE("CompressedBufferReader")
Reader.SetSource(Compressed);
{
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount, Count))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount, Count))));
}
{
UniqueBuffer Uncompressed = UniqueBuffer::Alloc(Count * sizeof(uint64_t));
if (Reader.TryDecompressTo(Uncompressed, OffsetCount * sizeof(uint64_t)))
{
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount, Count))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount, Count))));
}
}
};
@@ -2730,12 +2730,12 @@ TEST_CASE("CompressedBufferReader")
BufferReader Ar(Buffer.GetData(), int64_t(Buffer.GetSize()));
CompressedBufferReaderSourceScope Source(Reader, Ar);
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount))));
}
{
CompressedBufferReaderSourceScope Source(Reader, Compressed);
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount))));
}
// Short (malformed) Buffer
@@ -2770,12 +2770,12 @@ TEST_CASE("CompressedBufferReader")
BufferReader Ar(Buffer.GetData(), int64_t(Buffer.GetSize()));
CompressedBufferReaderSourceScope Source(Reader, Ar);
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount, Count))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount, Count))));
}
{
CompressedBufferReaderSourceScope Source(Reader, Compressed);
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount, Count))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount, Count))));
}
}
@@ -2793,14 +2793,14 @@ TEST_CASE("CompressedBufferReader")
constexpr uint64_t OffsetCount = 0;
constexpr uint64_t Count = N;
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount, Count))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount, Count))));
}
{
constexpr uint64_t OffsetCount = 21;
constexpr uint64_t Count = 999;
const SharedBuffer Uncompressed = Reader.Decompress(OffsetCount * sizeof(uint64_t), Count * sizeof(uint64_t));
- CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(std::span{ExpectedValues}.subspan(OffsetCount, Count))));
+ CHECK(Uncompressed.GetView().EqualBytes(MakeMemoryView(eastl::span{ExpectedValues}.subspan(OffsetCount, Count))));
}
// Short (malformed) Buffer
diff --git a/src/zencore/include/zencore/compactbinarypackage.h b/src/zencore/include/zencore/compactbinarypackage.h
index 9ec12cb0f..15daa6640 100644
--- a/src/zencore/include/zencore/compactbinarypackage.h
+++ b/src/zencore/include/zencore/compactbinarypackage.h
@@ -8,8 +8,8 @@
#include <zencore/compress.h>
#include <zencore/iohash.h>
+#include <EASTL/span.h>
#include <functional>
-#include <span>
#include <variant>
#include <EASTL/fixed_vector.h>
@@ -267,9 +267,9 @@ public:
}
/** Returns the attachments in this package. */
- inline std::span<const CbAttachment> GetAttachments() const
+ inline eastl::span<const CbAttachment> GetAttachments() const
{
- return std::span<const CbAttachment>(begin(Attachments), end(Attachments));
+ return eastl::span<const CbAttachment>(begin(Attachments), end(Attachments));
}
/**
@@ -289,7 +289,7 @@ public:
/** Add the attachment to this package, along with any references that can be resolved. */
inline void AddAttachment(const CbAttachment& Attachment, AttachmentResolver Resolver) { AddAttachment(Attachment, &Resolver); }
- void AddAttachments(std::span<const CbAttachment> Attachments);
+ void AddAttachments(eastl::span<const CbAttachment> Attachments);
void ReserveAttachments(size_t Count);
diff --git a/src/zencore/include/zencore/compositebuffer.h b/src/zencore/include/zencore/compositebuffer.h
index 153c7d9ce..4378e38fc 100644
--- a/src/zencore/include/zencore/compositebuffer.h
+++ b/src/zencore/include/zencore/compositebuffer.h
@@ -6,9 +6,9 @@
#include <zencore/sharedbuffer.h>
#include <zencore/zencore.h>
+#include <EASTL/span.h>
#include <EASTL/vector.h>
#include <functional>
-#include <span>
#include <EASTL/fixed_vector.h>
@@ -49,9 +49,9 @@ public:
[[nodiscard]] ZENCORE_API uint64_t GetSize() const;
/** Returns the segments that the buffer is composed from. */
- [[nodiscard]] inline std::span<const SharedBuffer> GetSegments() const
+ [[nodiscard]] inline eastl::span<const SharedBuffer> GetSegments() const
{
- return std::span<const SharedBuffer>{begin(m_Segments), end(m_Segments)};
+ return eastl::span<const SharedBuffer>{begin(m_Segments), end(m_Segments)};
}
/** Returns true if the composite buffer is not null. */
@@ -142,8 +142,8 @@ private:
inline void AppendBuffers(SharedBuffer&& Buffer) { m_Segments.push_back(std::move(Buffer)); }
inline void AppendBuffers(IoBuffer&& Buffer) { m_Segments.push_back(SharedBuffer(std::move(Buffer))); }
- static inline size_t GetBufferCount(std::span<IoBuffer>&& Container) { return Container.size(); }
- inline void AppendBuffers(std::span<IoBuffer>&& Container)
+ static inline size_t GetBufferCount(eastl::span<IoBuffer>&& Container) { return Container.size(); }
+ inline void AppendBuffers(eastl::span<IoBuffer>&& Container)
{
m_Segments.reserve(m_Segments.size() + Container.size());
for (IoBuffer& Buffer : Container)
diff --git a/src/zencore/include/zencore/memoryview.h b/src/zencore/include/zencore/memoryview.h
index 2d11450cc..4854afcea 100644
--- a/src/zencore/include/zencore/memoryview.h
+++ b/src/zencore/include/zencore/memoryview.h
@@ -7,10 +7,10 @@
#include <zencore/intmath.h>
#include <zencore/thread.h>
+#include <EASTL/span.h>
#include <EASTL/vector.h>
#include <cstddef>
#include <cstring>
-#include <span>
namespace zen {
@@ -307,7 +307,7 @@ template<ContiguousRange R>
[[nodiscard]] constexpr inline MemoryView
MakeMemoryView(const R& Container)
{
- std::span Span = Container;
+ eastl::span Span = Container;
return MemoryView(Span.data(), Span.size_bytes());
}
@@ -342,7 +342,7 @@ template<ContiguousRange R>
[[nodiscard]] constexpr inline MutableMemoryView
MakeMutableMemoryView(R& Container)
{
- std::span Span = Container;
+ eastl::span Span = Container;
return MutableMemoryView(Span.data(), Span.size_bytes());
}
diff --git a/src/zencore/include/zencore/sharedbuffer.h b/src/zencore/include/zencore/sharedbuffer.h
index 7df5109cb..4786d9a5b 100644
--- a/src/zencore/include/zencore/sharedbuffer.h
+++ b/src/zencore/include/zencore/sharedbuffer.h
@@ -157,7 +157,7 @@ public:
/** Make a non-owning view of the memory of the contiguous container. */
[[nodiscard]] inline static SharedBuffer MakeView(const ContiguousRange auto& Container)
{
- std::span Span = Container;
+ eastl::span Span = Container;
return MakeView(Span.data(), Span.size() * sizeof(typename decltype(Span)::element_type));
}
/** Make a non-owned view of the input */
diff --git a/src/zencore/include/zencore/string.h b/src/zencore/include/zencore/string.h
index 68129b691..375449a6f 100644
--- a/src/zencore/include/zencore/string.h
+++ b/src/zencore/include/zencore/string.h
@@ -5,6 +5,7 @@
#include "intmath.h"
#include "zencore.h"
+#include <EASTL/span.h>
#include <stdint.h>
#include <string.h>
#include <charconv>
@@ -12,9 +13,7 @@
#include <compare>
#include <concepts>
#include <optional>
-#include <span>
#include <string_view>
-
#include <type_traits>
namespace zen {
@@ -91,8 +90,8 @@ ZENCORE_API const char* FilepathFindExtension(const std::string_view& path, cons
// Text formatting of numbers
//
-ZENCORE_API bool ToString(std::span<char> Buffer, uint64_t Num);
-ZENCORE_API bool ToString(std::span<char> Buffer, int64_t Num);
+ZENCORE_API bool ToString(eastl::span<char> Buffer, uint64_t Num);
+ZENCORE_API bool ToString(eastl::span<char> Buffer, int64_t Num);
struct TextNumBase
{
@@ -683,11 +682,11 @@ ParseHexNumber(const std::string_view HexString, UnsignedIntegral auto& OutValue
// Format numbers for humans
//
-ZENCORE_API size_t NiceNumToBuffer(uint64_t Num, std::span<char> Buffer);
-ZENCORE_API size_t NiceBytesToBuffer(uint64_t Num, std::span<char> Buffer);
-ZENCORE_API size_t NiceByteRateToBuffer(uint64_t Num, uint64_t ms, std::span<char> Buffer);
-ZENCORE_API size_t NiceLatencyNsToBuffer(uint64_t NanoSeconds, std::span<char> Buffer);
-ZENCORE_API size_t NiceTimeSpanMsToBuffer(uint64_t Milliseconds, std::span<char> Buffer);
+ZENCORE_API size_t NiceNumToBuffer(uint64_t Num, eastl::span<char> Buffer);
+ZENCORE_API size_t NiceBytesToBuffer(uint64_t Num, eastl::span<char> Buffer);
+ZENCORE_API size_t NiceByteRateToBuffer(uint64_t Num, uint64_t ms, eastl::span<char> Buffer);
+ZENCORE_API size_t NiceLatencyNsToBuffer(uint64_t NanoSeconds, eastl::span<char> Buffer);
+ZENCORE_API size_t NiceTimeSpanMsToBuffer(uint64_t Milliseconds, eastl::span<char> Buffer);
struct NiceBase
{
@@ -733,7 +732,7 @@ NiceRate(uint64_t Num, uint64_t DurationMilliseconds, const char* Unit = "B")
if (DurationMilliseconds)
{
// Leave a little of 'Buffer' for the "Unit/s" suffix
- std::span<char> BufferSpan(Buffer, sizeof(Buffer) - 8);
+ eastl::span<char> BufferSpan(Buffer, sizeof(Buffer) - 8);
NiceNumToBuffer(Num * 1000 / DurationMilliseconds, BufferSpan);
}
else
diff --git a/src/zencore/jobqueue.cpp b/src/zencore/jobqueue.cpp
index bb113afa9..ef4f0dba1 100644
--- a/src/zencore/jobqueue.cpp
+++ b/src/zencore/jobqueue.cpp
@@ -476,7 +476,7 @@ TEST_CASE("JobQueue")
});
}
- auto Join = [](std::span<std::string> Strings, std::string_view Delimiter) -> std::string {
+ auto Join = [](eastl::span<std::string> Strings, std::string_view Delimiter) -> std::string {
ExtendableStringBuilder<128> SB;
if (Strings.empty())
{
diff --git a/src/zencore/memtrack/callstacktrace.cpp b/src/zencore/memtrack/callstacktrace.cpp
index d860c05d1..f7e66660c 100644
--- a/src/zencore/memtrack/callstacktrace.cpp
+++ b/src/zencore/memtrack/callstacktrace.cpp
@@ -56,7 +56,7 @@ CallstackTrace_Initialize()
# include <zencore/trace.h>
# include <atomic>
-# include <span>
+# include <EASTL/span.h>
# include <zencore/windows.h>
@@ -396,7 +396,7 @@ FBacktracer::FBacktracer(FMalloc* InMalloc)
////////////////////////////////////////////////////////////////////////////////
FBacktracer::~FBacktracer()
{
- std::span<FModule> ModulesView(Modules, ModulesNum);
+ eastl::span<FModule> ModulesView(Modules, ModulesNum);
for (FModule& Module : ModulesView)
{
Malloc->Free(Module.Functions);
@@ -730,9 +730,9 @@ FBacktracer::LookupFunction(uintptr_t Address, FLookupState& State) const
// Now we've a module we have a table of functions and their stack sizes so
// we can get the frame size for Address
- uint32_t FuncId = uint32_t(Address - IdToAddress(Module->Id));
- std::span<FFunction> FuncsView(Module->Functions, Module->NumFunctions);
- auto FindIt = std::upper_bound(begin(FuncsView), end(FuncsView), FuncId, IdPredicate);
+ uint32_t FuncId = uint32_t(Address - IdToAddress(Module->Id));
+ eastl::span<FFunction> FuncsView(Module->Functions, Module->NumFunctions);
+ auto FindIt = std::upper_bound(begin(FuncsView), end(FuncsView), FuncId, IdPredicate);
if (FindIt == begin(FuncsView))
{
return nullptr;
diff --git a/src/zencore/string.cpp b/src/zencore/string.cpp
index a0d8c927f..758c06755 100644
--- a/src/zencore/string.cpp
+++ b/src/zencore/string.cpp
@@ -47,14 +47,14 @@ utf32to8_impl(u32bit_iterator StartIt, u32bit_iterator EndIt, ::zen::StringBuild
namespace zen {
bool
-ToString(std::span<char> Buffer, uint64_t Num)
+ToString(eastl::span<char> Buffer, uint64_t Num)
{
snprintf(Buffer.data(), Buffer.size(), "%" PRIu64, Num);
return true;
}
bool
-ToString(std::span<char> Buffer, int64_t Num)
+ToString(eastl::span<char> Buffer, int64_t Num)
{
snprintf(Buffer.data(), Buffer.size(), "%" PRId64, Num);
@@ -253,7 +253,7 @@ namespace {
* Convert a number to an appropriately human-readable output.
*/
int
-NiceNumGeneral(uint64_t Num, std::span<char> Buffer, NicenumFormat Format)
+NiceNumGeneral(uint64_t Num, eastl::span<char> Buffer, NicenumFormat Format)
{
switch (Format)
{
@@ -351,19 +351,19 @@ NiceNumGeneral(uint64_t Num, std::span<char> Buffer, NicenumFormat Format)
}
size_t
-NiceNumToBuffer(uint64_t Num, std::span<char> Buffer)
+NiceNumToBuffer(uint64_t Num, eastl::span<char> Buffer)
{
return NiceNumGeneral(Num, Buffer, kNicenum1024);
}
size_t
-NiceBytesToBuffer(uint64_t Num, std::span<char> Buffer)
+NiceBytesToBuffer(uint64_t Num, eastl::span<char> Buffer)
{
return NiceNumGeneral(Num, Buffer, kNicenumBytes);
}
size_t
-NiceByteRateToBuffer(uint64_t Num, uint64_t ElapsedMs, std::span<char> Buffer)
+NiceByteRateToBuffer(uint64_t Num, uint64_t ElapsedMs, eastl::span<char> Buffer)
{
size_t n = 0;
@@ -385,13 +385,13 @@ NiceByteRateToBuffer(uint64_t Num, uint64_t ElapsedMs, std::span<char> Buffer)
}
size_t
-NiceLatencyNsToBuffer(uint64_t Nanos, std::span<char> Buffer)
+NiceLatencyNsToBuffer(uint64_t Nanos, eastl::span<char> Buffer)
{
return NiceNumGeneral(Nanos, Buffer, kNicenumTime);
}
size_t
-NiceTimeSpanMsToBuffer(uint64_t Millis, std::span<char> Buffer)
+NiceTimeSpanMsToBuffer(uint64_t Millis, eastl::span<char> Buffer)
{
if (Millis < 1000)
{