diff options
Diffstat (limited to 'source/compiler-core')
| -rw-r--r-- | source/compiler-core/slang-diagnostic-sink.h | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-name.cpp | 7 | ||||
| -rw-r--r-- | source/compiler-core/slang-name.h | 1 | ||||
| -rw-r--r-- | source/compiler-core/slang-slice-allocator.h | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/source/compiler-core/slang-diagnostic-sink.h b/source/compiler-core/slang-diagnostic-sink.h index e4d131e37..fc5e31b47 100644 --- a/source/compiler-core/slang-diagnostic-sink.h +++ b/source/compiler-core/slang-diagnostic-sink.h @@ -310,7 +310,7 @@ private: class DiagnosticsLookup : public RefObject { public: - static const Index kArenaInitialSize = 2048; + static const Index kArenaInitialSize = 65536; /// Will take into account the slice name could be using different conventions const DiagnosticInfo* findDiagnosticByName(const UnownedStringSlice& slice) const; diff --git a/source/compiler-core/slang-name.cpp b/source/compiler-core/slang-name.cpp index cc2033339..c815b8aa8 100644 --- a/source/compiler-core/slang-name.cpp +++ b/source/compiler-core/slang-name.cpp @@ -19,7 +19,7 @@ const char* getCstr(Name* name) return name ? name->text.getBuffer() : nullptr; } -Name* NamePool::getName(String const& text) +Name* NamePool::getName(UnownedStringSlice text) { RefPtr<Name> name; if (rootPool->names.tryGetValue(text, name)) @@ -31,6 +31,11 @@ Name* NamePool::getName(String const& text) return name; } +Name* NamePool::getName(String const& text) +{ + return getName(text.getUnownedSlice()); +} + Name* NamePool::tryGetName(String const& text) { RefPtr<Name> name; diff --git a/source/compiler-core/slang-name.h b/source/compiler-core/slang-name.h index cf702686b..f8c1201af 100644 --- a/source/compiler-core/slang-name.h +++ b/source/compiler-core/slang-name.h @@ -68,6 +68,7 @@ struct RootNamePool struct NamePool { // Find or create the `Name` that represents the given `text`. + Name* getName(UnownedStringSlice text); Name* getName(String const& text); // Try find the `Name` that represents the given `text`. // If the name does not exist, return nullptr diff --git a/source/compiler-core/slang-slice-allocator.h b/source/compiler-core/slang-slice-allocator.h index e4ba9e907..a6f0cd5c1 100644 --- a/source/compiler-core/slang-slice-allocator.h +++ b/source/compiler-core/slang-slice-allocator.h @@ -97,7 +97,7 @@ struct SliceAllocator void deallocateAll() { m_arena.deallocateAll(); } SliceAllocator(): - m_arena(1024) + m_arena(2097152) { } protected: |
