mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
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.
This commit is contained in:
parent
39a74676bd
commit
bbb4eb0aa1
Notes:
sideshowbarker
2024-07-18 02:05:15 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/bbb4eb0aa10 Pull-request: https://github.com/SerenityOS/serenity/pull/10558
|
@ -981,9 +981,9 @@ inline static KResultOr<NonnullOwnPtr<KString>> try_copy_kstring_from_user(const
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return AK::Formatter<String>::format(builder, String::formatted("{}({})", value.name(), value.pid().value()));
|
||||
return AK::Formatter<FormatString>::format(builder, "{}({})", value.name(), value.pid().value());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue