mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Kernel: Deduplicate signpost perf event strings
This commit is contained in:
parent
d600f0d5b3
commit
e1e91f6c85
2 changed files with 3 additions and 3 deletions
|
@ -169,7 +169,7 @@ KResult PerformanceEventBuffer::to_json_impl(Serializer& object) const
|
|||
{
|
||||
auto strings = object.add_array("strings");
|
||||
for (auto& it : m_strings) {
|
||||
strings.add(it.view());
|
||||
strings.add(it->view());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ KResultOr<FlatPtr> PerformanceEventBuffer::register_string(NonnullOwnPtr<KString
|
|||
{
|
||||
FlatPtr string_id = m_strings.size();
|
||||
|
||||
if (!m_strings.try_append(move(string)))
|
||||
if (m_strings.try_set(move(string)) == AK::HashSetResult::Failed)
|
||||
return ENOBUFS;
|
||||
|
||||
return string_id;
|
||||
|
|
|
@ -133,7 +133,7 @@ private:
|
|||
size_t m_count { 0 };
|
||||
NonnullOwnPtr<KBuffer> m_buffer;
|
||||
|
||||
NonnullOwnPtrVector<KString> m_strings;
|
||||
HashTable<NonnullOwnPtr<KString>> m_strings;
|
||||
};
|
||||
|
||||
extern bool g_profiling_all_threads;
|
||||
|
|
Loading…
Add table
Reference in a new issue