From bbb4eb0aa10bb93f290d8016c5645a2cf960ada4 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Thu, 21 Oct 2021 19:26:36 +0200 Subject: [PATCH] Kernel: Convert Formatter to use Formatter This lets us avoid allocating memory on the heap most of the time, as Formatter writes into a quite large stack buffer instead. --- Kernel/Process.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Process.h b/Kernel/Process.h index 2f8cceb1fa..1806dad3f6 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -981,9 +981,9 @@ inline static KResultOr> try_copy_kstring_from_user(const } template<> -struct AK::Formatter : AK::Formatter { +struct AK::Formatter : AK::Formatter { void format(FormatBuilder& builder, const Kernel::Process& value) { - return AK::Formatter::format(builder, String::formatted("{}({})", value.name(), value.pid().value())); + return AK::Formatter::format(builder, "{}({})", value.name(), value.pid().value()); } };