aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore/httpprojectstore.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-03-06 17:27:59 +0100
committerStefan Boberg <[email protected]>2025-03-06 17:27:59 +0100
commit66e5d1f4e288e0c32f854ebe3b63584b42b83554 (patch)
treed67e9d358419b5baccd429d54988414e0d7cd7a6 /src/zenserver/projectstore/httpprojectstore.cpp
parentreduced memory churn using fixed_xxx containers (#236) (diff)
downloadzen-66e5d1f4e288e0c32f854ebe3b63584b42b83554.tar.xz
zen-66e5d1f4e288e0c32f854ebe3b63584b42b83554.zip
switched std::vector -> eastl::vector
Diffstat (limited to 'src/zenserver/projectstore/httpprojectstore.cpp')
-rw-r--r--src/zenserver/projectstore/httpprojectstore.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/zenserver/projectstore/httpprojectstore.cpp b/src/zenserver/projectstore/httpprojectstore.cpp
index 47748dd90..80e09939a 100644
--- a/src/zenserver/projectstore/httpprojectstore.cpp
+++ b/src/zenserver/projectstore/httpprojectstore.cpp
@@ -192,13 +192,13 @@ namespace {
Cbo.EndObject();
}
- void CbWriteOplogs(CidStore& CidStore,
- ProjectStore::Project& Project,
- std::vector<std::string> OpLogs,
- bool Details,
- bool OpDetails,
- bool AttachmentDetails,
- CbObjectWriter& Cbo)
+ void CbWriteOplogs(CidStore& CidStore,
+ ProjectStore::Project& Project,
+ eastl::vector<std::string> OpLogs,
+ bool Details,
+ bool OpDetails,
+ bool AttachmentDetails,
+ CbObjectWriter& Cbo)
{
Cbo.BeginArray("oplogs");
{
@@ -214,13 +214,13 @@ namespace {
Cbo.EndArray();
}
- void CbWriteProject(CidStore& CidStore,
- ProjectStore::Project& Project,
- std::vector<std::string> OpLogs,
- bool Details,
- bool OpDetails,
- bool AttachmentDetails,
- CbObjectWriter& Cbo)
+ void CbWriteProject(CidStore& CidStore,
+ ProjectStore::Project& Project,
+ eastl::vector<std::string> OpLogs,
+ bool Details,
+ bool OpDetails,
+ bool AttachmentDetails,
+ CbObjectWriter& Cbo)
{
Cbo.BeginObject();
{
@@ -537,7 +537,7 @@ HttpProjectService::HandleChunkBatchRequest(HttpRouterRequest& Req)
HttpReq.WriteResponse(HttpResponseCode::BadRequest);
}
- std::vector<RequestChunkEntry> RequestedChunks;
+ eastl::vector<RequestChunkEntry> RequestedChunks;
RequestedChunks.resize(RequestHdr.ChunkCount);
Reader.Read(RequestedChunks.data(), sizeof(RequestChunkEntry) * RequestHdr.ChunkCount);
@@ -558,7 +558,7 @@ HttpProjectService::HandleChunkBatchRequest(HttpRouterRequest& Req)
uint64_t ChunkSize;
};
- std::vector<IoBuffer> OutBlobs;
+ eastl::vector<IoBuffer> OutBlobs;
OutBlobs.emplace_back(sizeof(ResponseHeader) + RequestHdr.ChunkCount * sizeof(ResponseChunkEntry));
for (uint32_t ChunkIndex = 0; ChunkIndex < RequestHdr.ChunkCount; ++ChunkIndex)
{
@@ -607,7 +607,7 @@ HttpProjectService::HandleChunkBatchRequest(HttpRouterRequest& Req)
memcpy(ResponsePtr, &ResponseChunk, sizeof(ResponseChunk));
ResponsePtr += sizeof(ResponseChunk);
}
- std::erase_if(OutBlobs, [](IoBuffer Buffer) -> bool { return !Buffer; });
+ zen::erase_if(OutBlobs, [](IoBuffer Buffer) -> bool { return !Buffer; });
return HttpReq.WriteResponse(HttpResponseCode::OK, HttpContentType::kBinary, OutBlobs);
}
@@ -983,7 +983,7 @@ HttpProjectService::HandleOplogOpPrepRequest(HttpRouterRequest& Req)
IoBuffer Payload = HttpReq.ReadPayload();
CbObject RequestObject = LoadCompactBinaryObject(Payload);
- std::vector<IoHash> NeedList;
+ eastl::vector<IoHash> NeedList;
{
eastl::fixed_vector<IoHash, 16> ChunkList;
@@ -1063,8 +1063,8 @@ HttpProjectService::HandleOplogOpNewRequest(HttpRouterRequest& Req)
// the prep step rejected the chunk. This should be fixed since there's
// a performance cost associated with any file system activity
- bool IsValid = true;
- std::vector<IoHash> MissingChunks;
+ bool IsValid = true;
+ eastl::vector<IoHash> MissingChunks;
CbPackage::AttachmentResolver Resolver = [&](const IoHash& Hash) -> SharedBuffer {
if (m_CidStore.ContainsChunk(Hash))
@@ -1790,7 +1790,7 @@ HttpProjectService::HandleProjectRequest(HttpRouterRequest& Req)
}
Project->TouchProject();
- std::vector<std::string> OpLogs = Project->ScanForOplogs();
+ eastl::vector<std::string> OpLogs = Project->ScanForOplogs();
CbObjectWriter Response;
Response << "id"sv << Project->Identifier;
@@ -1984,7 +1984,7 @@ HttpProjectService::HandleDetailsRequest(HttpRouterRequest& Req)
m_ProjectStore->DiscoverProjects();
m_ProjectStore->IterateProjects([&](ProjectStore::Project& Project) {
- std::vector<std::string> OpLogs = Project.ScanForOplogs();
+ eastl::vector<std::string> OpLogs = Project.ScanForOplogs();
CbWriteProject(m_CidStore, Project, OpLogs, Details, OpDetails, AttachmentDetails, Cbo);
});
}
@@ -2031,8 +2031,8 @@ HttpProjectService::HandleProjectDetailsRequest(HttpRouterRequest& Req)
}
else
{
- CbObjectWriter Cbo;
- std::vector<std::string> OpLogs = FoundProject->ScanForOplogs();
+ CbObjectWriter Cbo;
+ eastl::vector<std::string> OpLogs = FoundProject->ScanForOplogs();
Cbo.BeginArray("projects");
{
CbWriteProject(m_CidStore, Project, OpLogs, Details, OpDetails, AttachmentDetails, Cbo);