Preallocate the maximum number of FileHandle pointers (fds) in every process.

This could even use a more specific data structure since it doesn't need the
grow/shrink capabilities of a vector.
This commit is contained in:
Andreas Kling 2018-11-01 13:39:28 +01:00
parent fce81d376c
commit 065f0aee35
Notes: sideshowbarker 2024-07-19 18:34:54 +09:00
4 changed files with 37 additions and 18 deletions

View file

@ -203,7 +203,7 @@ ByteBuffer procfs$summary()
toString(process->state()),
process->parentPID(),
process->timesScheduled(),
process->fileHandleCount(),
process->number_of_open_file_descriptors(),
process->tty() ? strrchr(process->tty()->ttyName().characters(), '/') + 1 : "n/a",
process->name().characters());
}