mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
Kernel: Use StringView when parsing pledges in sys$pledge(..)
This ensures no potential allocation as in some cases the pledge char* could be promoted to AK::String by the compiler to execute the comparison.
This commit is contained in:
parent
c2282ee28d
commit
9d8482c3e8
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ KResultOr<FlatPtr> Process::sys$pledge(Userspace<const Syscall::SC_pledge_params
|
|||
auto parts = pledge_spec.split_view(' ');
|
||||
for (auto& part : parts) {
|
||||
#define __ENUMERATE_PLEDGE_PROMISE(x) \
|
||||
if (part == #x) { \
|
||||
if (part == StringView { #x }) { \
|
||||
mask |= (1u << (u32)Pledge::x); \
|
||||
continue; \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue