summaryrefslogtreecommitdiff
path: root/Kernel/Thread.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-28 09:33:14 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-28 09:37:09 +0200
commitfc9ce229819c232e8960fe14e14157ab2befd43c (patch)
tree2d2a4a949726de8e79898847f11709523cb68e07 /Kernel/Thread.cpp
parenta1944ec966a6ecba82e8e0c3ad1e19d1fade595c (diff)
downloadserenity-fc9ce229819c232e8960fe14e14157ab2befd43c.zip
Kernel: Use KString for Region names
Replace the AK::String used for Region::m_name with a KString. This seems beneficial across the board, but as a specific data point, it reduces time spent in sys$set_mmap_name() by ~50% on test-js. :^)
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r--Kernel/Thread.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp
index e08ea0a2d9..3939d0d82b 100644
--- a/Kernel/Thread.cpp
+++ b/Kernel/Thread.cpp
@@ -67,7 +67,11 @@ Thread::Thread(NonnullRefPtr<Process> process, NonnullOwnPtr<Region> kernel_stac
m_tid = Process::allocate_pid().value();
}
- m_kernel_stack_region->set_name(String::formatted("Kernel stack (thread {})", m_tid.value()));
+ {
+ // FIXME: Go directly to KString
+ auto string = String::formatted("Kernel stack (thread {})", m_tid.value());
+ m_kernel_stack_region->set_name(KString::try_create(string));
+ }
{
ScopedSpinLock lock(g_tid_map_lock);