Kernel: Switch m_signal_action_data to Array<...>

This commit is contained in:
Brian Gianforcaro 2021-02-21 02:59:53 -08:00 committed by Andreas Kling
parent a977cdd9ac
commit dae071629f
Notes: sideshowbarker 2024-07-18 22:03:28 +09:00
2 changed files with 5 additions and 5 deletions

View file

@ -547,9 +547,7 @@ void Thread::clear_signals()
m_signal_mask = 0;
m_pending_signals = 0;
m_have_any_unmasked_pending_signals.store(false, AK::memory_order_release);
Span<SignalActionData> action_data(m_signal_action_data);
action_data.fill({});
m_signal_action_data.fill({});
}
// Certain exceptions, such as SIGSEGV and SIGILL, put a
@ -868,7 +866,8 @@ RefPtr<Thread> Thread::clone(Process& process)
if (thread_or_error.is_error())
return {};
auto& clone = thread_or_error.value();
memcpy(clone->m_signal_action_data, m_signal_action_data, sizeof(m_signal_action_data));
auto signal_action_data_span = m_signal_action_data.span();
signal_action_data_span.copy_to(clone->m_signal_action_data.span());
clone->m_signal_mask = m_signal_mask;
memcpy(clone->m_fpu_state, m_fpu_state, sizeof(FPUState));
clone->m_thread_specific_data = m_thread_specific_data;

View file

@ -47,6 +47,7 @@
#include <Kernel/TimerQueue.h>
#include <Kernel/UnixTypes.h>
#include <LibC/fd_set.h>
#include <LibC/signal_numbers.h>
namespace Kernel {
@ -1239,7 +1240,7 @@ private:
u32 m_kernel_stack_top { 0 };
OwnPtr<Region> m_kernel_stack_region;
VirtualAddress m_thread_specific_data;
SignalActionData m_signal_action_data[32] { };
Array<SignalActionData, NSIG> m_signal_action_data;
Blocker* m_blocker { nullptr };
#if LOCK_DEBUG