Simplified VectorArena to always take an arena and to not support change of capacity

This commit is contained in:
2026-07-22 22:12:05 -04:00
parent c0d40ef3e4
commit 9c8f9bff41
12 changed files with 213 additions and 197 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ namespace Romeo
struct Database
{
Juliet::VectorArena<FileEntry, 512, true> Entries = {};
Juliet::VectorArena<FileEntry, 512> Entries = {};
Juliet::Arena* DbArena = nullptr;
Juliet::Mutex Mutex;
};
+2 -2
View File
@@ -31,8 +31,8 @@ namespace Romeo
double NumVal = 0.0;
Juliet::String StrVal = {};
Juliet::VectorArena<JsonValue, 32, true> ArrayVal = {};
Juliet::VectorArena<JsonKeyValue, 32, true> ObjectVal = {};
Juliet::VectorArena<JsonValue, 32> ArrayVal = {};
Juliet::VectorArena<JsonKeyValue, 32> ObjectVal = {};
};
// Parses a JSON string. Memory is allocated on the provided arena.
+3 -3
View File
@@ -410,7 +410,7 @@ namespace Romeo
static void ParseSymbolsFromFile(
Juliet::Arena* arena,
const Juliet::String& filePath,
Juliet::VectorArena<ParsedSymbol, 128, true>& outSymbols
Juliet::VectorArena<ParsedSymbol, 128>& outSymbols
)
{
Assert(arena != nullptr);
@@ -726,7 +726,7 @@ namespace Romeo
static void FormatAndWriteSymbols(StringBuilder& sb, Juliet::Arena* arena, const Juliet::String& filePath)
{
printf("Romeo: FormatAndWriteSymbols start for %.*s\n", static_cast<int>(filePath.Size), CStr(filePath));
Juliet::VectorArena<ParsedSymbol, 128, true> symbols = {};
Juliet::VectorArena<ParsedSymbol, 128> symbols = {};
symbols.Create(arena JULIET_DEBUG_ONLY(, "ParsedSymbols"));
printf("Romeo: Calling ParseSymbolsFromFile...\n");
@@ -741,7 +741,7 @@ namespace Romeo
// Collect all distinct namespaces
printf("Romeo: Collecting namespaces...\n");
Juliet::VectorArena<Juliet::String, 16, true> namespaces = {};
Juliet::VectorArena<Juliet::String, 16> namespaces = {};
namespaces.Create(arena JULIET_DEBUG_ONLY(, "NamespacesList"));
for (const ParsedSymbol& sym : symbols)