From 03b735228685a372b7e3a63d50cd666ed8b0b30e Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 15 Jan 2022 21:16:53 +0200 Subject: [PATCH] Kernel: Specify inline capacity of return type in capture_stack_trace Since the inline capacity of the Vector return type was not specified explicitly, the vector was automatically copied to a 0-length inline capacity one, essentially eliminating the optimization. --- Kernel/Arch/x86/Processor.h | 2 +- Kernel/Arch/x86/common/Processor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Arch/x86/Processor.h b/Kernel/Arch/x86/Processor.h index 8455e55bf15..b36f0071c2e 100644 --- a/Kernel/Arch/x86/Processor.h +++ b/Kernel/Arch/x86/Processor.h @@ -398,7 +398,7 @@ public: NEVER_INLINE void switch_context(Thread*& from_thread, Thread*& to_thread); [[noreturn]] static void assume_context(Thread& thread, FlatPtr flags); FlatPtr init_context(Thread& thread, bool leave_crit); - static Vector capture_stack_trace(Thread& thread, size_t max_frames = 0); + static Vector capture_stack_trace(Thread& thread, size_t max_frames = 0); static StringView platform_string(); }; diff --git a/Kernel/Arch/x86/common/Processor.cpp b/Kernel/Arch/x86/common/Processor.cpp index 135627fe5be..dfcdf9ab00f 100644 --- a/Kernel/Arch/x86/common/Processor.cpp +++ b/Kernel/Arch/x86/common/Processor.cpp @@ -491,7 +491,7 @@ const DescriptorTablePointer& Processor::get_gdtr() return m_gdtr; } -Vector Processor::capture_stack_trace(Thread& thread, size_t max_frames) +Vector Processor::capture_stack_trace(Thread& thread, size_t max_frames) { FlatPtr frame_ptr = 0, ip = 0; Vector stack_trace;