mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Kernel: Call try_set_coredump_property with StringView arguments
Storing assigning a string literal to a String object just to pass it to a function expecting a StringView is wasteful. Let's just not do that. For consistency's sake, this commit changes all of the other invocations to use StringView literals, too.
This commit is contained in:
parent
bbb4eb0aa1
commit
17b66eaa3c
Notes:
sideshowbarker
2024-07-18 02:05:11 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/17b66eaa3c5 Pull-request: https://github.com/SerenityOS/serenity/pull/10558
1 changed files with 6 additions and 6 deletions
|
@ -403,14 +403,14 @@ void page_fault_handler(TrapFrame* trap)
|
|||
if (current_thread) {
|
||||
auto& current_process = current_thread->process();
|
||||
if (current_process.is_user_process()) {
|
||||
(void)current_process.try_set_coredump_property("fault_address", String::formatted("{:p}", fault_address));
|
||||
(void)current_process.try_set_coredump_property("fault_type", fault.type() == PageFault::Type::PageNotPresent ? "NotPresent" : "ProtectionViolation");
|
||||
String fault_access;
|
||||
(void)current_process.try_set_coredump_property("fault_address"sv, String::formatted("{:p}", fault_address));
|
||||
(void)current_process.try_set_coredump_property("fault_type"sv, fault.type() == PageFault::Type::PageNotPresent ? "NotPresent"sv : "ProtectionViolation"sv);
|
||||
StringView fault_access;
|
||||
if (fault.is_instruction_fetch())
|
||||
fault_access = "Execute";
|
||||
fault_access = "Execute"sv;
|
||||
else
|
||||
fault_access = fault.access() == PageFault::Access::Read ? "Read" : "Write";
|
||||
(void)current_process.try_set_coredump_property("fault_access", fault_access);
|
||||
fault_access = fault.access() == PageFault::Access::Read ? "Read"sv : "Write"sv;
|
||||
(void)current_process.try_set_coredump_property("fault_access"sv, fault_access);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue