mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
Kernel: Reduce kmallocing in /proc/all and /proc/memstat.
This commit is contained in:
parent
88f03f86ff
commit
2533e0b57b
1 changed files with 2 additions and 2 deletions
|
@ -558,7 +558,7 @@ ByteBuffer procfs$summary(InodeIdentifier)
|
||||||
ByteBuffer procfs$memstat(InodeIdentifier)
|
ByteBuffer procfs$memstat(InodeIdentifier)
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
StringBuilder builder;
|
StringBuilder builder(128);
|
||||||
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%u,%u\n",
|
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%u,%u\n",
|
||||||
kmalloc_sum_eternal,
|
kmalloc_sum_eternal,
|
||||||
sum_alloc,
|
sum_alloc,
|
||||||
|
@ -577,7 +577,7 @@ ByteBuffer procfs$all(InodeIdentifier)
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
auto processes = Process::all_processes();
|
auto processes = Process::all_processes();
|
||||||
StringBuilder builder;
|
StringBuilder builder(processes.size() * 80);
|
||||||
auto build_process_line = [&builder] (Process* process) {
|
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",
|
builder.appendf("%u,%u,%u,%u,%u,%u,%u,%s,%u,%u,%s,%s,%u,%u,%u,%u,%s\n",
|
||||||
process->pid(),
|
process->pid(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue