1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

Kernel: Don't copy a Vector<FileDescriptionAndFlags>

Instead of copying a Vector everytime we need to enumerate a Process'
file descriptions, we can just temporarily lock so it won't change.
This commit is contained in:
Liav A 2021-06-22 21:22:17 +03:00 committed by Andreas Kling
parent 12b6e69150
commit 7c87891c06
28 changed files with 198 additions and 128 deletions

View file

@ -24,7 +24,7 @@ KResultOr<FlatPtr> Process::sys$anon_create(size_t size, int options)
if (size > NumericLimits<ssize_t>::max())
return EINVAL;
int new_fd = alloc_fd();
int new_fd = m_fds.allocate();
if (new_fd < 0)
return new_fd;