mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
AK+Kernel: Specialize Trie for NNOP<KString> and use it in UnveilNode
This let's us avoid the infallible String allocations.
This commit is contained in:
parent
0218c62be4
commit
316fa0c3f3
Notes:
sideshowbarker
2024-07-17 21:16:31 +09:00
Author: https://github.com/IdanHo
Commit: 316fa0c3f3
Pull-request: https://github.com/SerenityOS/serenity/pull/12564
Reviewed-by: https://github.com/MaxWipfli
6 changed files with 31 additions and 13 deletions
|
@ -218,7 +218,8 @@ void Process::unprotect_data()
|
|||
ErrorOr<NonnullRefPtr<Process>> Process::try_create(RefPtr<Thread>& first_thread, NonnullOwnPtr<KString> name, UserID uid, GroupID gid, ProcessID ppid, bool is_kernel_process, RefPtr<Custody> cwd, RefPtr<Custody> executable, TTY* tty, Process* fork_parent)
|
||||
{
|
||||
auto space = TRY(Memory::AddressSpace::try_create(fork_parent ? &fork_parent->address_space() : nullptr));
|
||||
auto process = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Process(move(name), uid, gid, ppid, is_kernel_process, move(cwd), move(executable), tty, UnveilNode { "/"sv, UnveilMetadata(TRY(KString::try_create("/"sv))) })));
|
||||
auto unveil_tree = UnveilNode { TRY(KString::try_create("/"sv)), UnveilMetadata(TRY(KString::try_create("/"sv))) };
|
||||
auto process = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Process(move(name), uid, gid, ppid, is_kernel_process, move(cwd), move(executable), tty, move(unveil_tree))));
|
||||
TRY(process->attach_resources(move(space), first_thread, fork_parent));
|
||||
return process;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue