summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-16 00:36:17 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-16 00:36:17 +0200
commit2533e0b57b5fe4e8ffc15270959beb3c5932e991 (patch)
tree86b8f808f6eb510c88f2ecf19ef87ba15dddca95 /Kernel
parent88f03f86ff4659c9cabd484b1ee37bd044681a26 (diff)
downloadserenity-2533e0b57b5fe4e8ffc15270959beb3c5932e991.zip
Kernel: Reduce kmallocing in /proc/all and /proc/memstat.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FileSystem/ProcFS.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp
index 2cf3c5d5db..b0d26c7fe2 100644
--- a/Kernel/FileSystem/ProcFS.cpp
+++ b/Kernel/FileSystem/ProcFS.cpp
@@ -558,7 +558,7 @@ ByteBuffer procfs$summary(InodeIdentifier)
ByteBuffer procfs$memstat(InodeIdentifier)
{
InterruptDisabler disabler;
- StringBuilder builder;
+ StringBuilder builder(128);
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%u,%u\n",
kmalloc_sum_eternal,
sum_alloc,
@@ -577,7 +577,7 @@ ByteBuffer procfs$all(InodeIdentifier)
{
InterruptDisabler disabler;
auto processes = Process::all_processes();
- StringBuilder builder;
+ StringBuilder builder(processes.size() * 80);
auto build_process_line = [&builder] (Process* process) {
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%s,%u,%u,%s,%s,%u,%u,%u,%u,%s\n",
process->pid(),