Selaa lähdekoodia

Kernel: Convert Formatter<Process> to use Formatter<FormatString>

This lets us avoid allocating memory on the heap most of the time, as
Formatter<FormatString> writes into a quite large stack buffer instead.
Daniel Bertalan 3 vuotta sitten
vanhempi
commit
bbb4eb0aa1
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      Kernel/Process.h

+ 2 - 2
Kernel/Process.h

@@ -981,9 +981,9 @@ inline static KResultOr<NonnullOwnPtr<KString>> try_copy_kstring_from_user(const
 }
 }
 
 
 template<>
 template<>
-struct AK::Formatter<Kernel::Process> : AK::Formatter<String> {
+struct AK::Formatter<Kernel::Process> : AK::Formatter<FormatString> {
     void format(FormatBuilder& builder, const Kernel::Process& value)
     void format(FormatBuilder& builder, const Kernel::Process& value)
     {
     {
-        return AK::Formatter<String>::format(builder, String::formatted("{}({})", value.name(), value.pid().value()));
+        return AK::Formatter<FormatString>::format(builder, "{}({})", value.name(), value.pid().value());
     }
     }
 };
 };