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. :^)
This commit is contained in:
Andreas Kling 2021-05-28 09:33:14 +02:00
parent a1944ec966
commit fc9ce22981
Notes: sideshowbarker 2024-07-18 17:16:49 +09:00
10 changed files with 64 additions and 62 deletions

View file

@ -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);