BigFile/Sasquatch #1

Merged
rboullard merged 100 commits from BigFile into Development 2026-09-01 16:32:02 +00:00
2 changed files with 14 additions and 6 deletions
Showing only changes of commit dbb03e3088 - Show all commits
@@ -12,6 +12,8 @@
#include <System/File/MemoryMappedFile.hpp>
#include <System/UUID/UUID.hpp>
#include <Utils/TargetMacros.h>
#include <EASTL/span.h>
#include <EASTL/vector.h>
#include <ankerl/unordered_dense.h>
@@ -97,7 +99,7 @@ class SasquatchWriter
/**
* The number of assets expected
*/
std::uint64_t m_assetCount;
BIGFOOT_NOT_OPTIMIZED_ONLY(std::uint64_t m_assetCount);
/**
* The offset the next WriteAsset call will write to
+11 -5
View File
@@ -17,7 +17,7 @@ namespace Bigfoot
SasquatchWriter::SasquatchWriter(const File& p_file,
const std::uint64_t p_assetCount,
const std::size_t p_totalFlatbufferBytes):
m_assetCount(p_assetCount),
BIGFOOT_NOT_OPTIMIZED_ONLY(m_assetCount(p_assetCount),)
m_nextOffset(sizeof(SasquatchHeader) + p_assetCount * sizeof(SasquatchEntry)),
m_prefetchedUpTo(0),
m_file(p_file, m_nextOffset + p_totalFlatbufferBytes)
@@ -42,9 +42,12 @@ SasquatchWriter::~SasquatchWriter()
m_file.Prefetch(sizeof(SasquatchHeader), m_entries.size() * sizeof(SasquatchEntry));
std::memcpy(m_file.GetData().data() + sizeof(SasquatchHeader),
m_entries.data(),
m_entries.size() * sizeof(SasquatchEntry));
if (!m_entries.empty())
{
std::memcpy(m_file.GetData().data() + sizeof(SasquatchHeader),
m_entries.data(),
m_entries.size() * sizeof(SasquatchEntry));
}
}
/****************************************************************************************/
@@ -118,7 +121,10 @@ Sasquatch::Sasquatch(const File& p_file):
sizeof(SasquatchHeader) + header.m_assetCount * sizeof(SasquatchEntry));
eastl::vector<SasquatchEntry> entries(header.m_assetCount);
std::memcpy(entries.data(), data.data() + sizeof(SasquatchHeader), entries.size() * sizeof(SasquatchEntry));
if (!entries.empty())
{
std::memcpy(entries.data(), data.data() + sizeof(SasquatchHeader), entries.size() * sizeof(SasquatchEntry));
}
m_entries.reserve(header.m_assetCount);
for (const SasquatchEntry& entry: entries)