summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2018-10-12 10:57:28 -0400
committerGravatar Lioncash2018-10-12 10:57:31 -0400
commitb492d43e63a80d926ca0bb35577761cabee2d13c (patch)
tree16bdfd11f80396ae0f92dec0d5fde6c6a902ba17
parentMerge pull request #1474 from ogniK5377/hwopus-decodeinterleavedwithperformance (diff)
downloadyuzu-b492d43e63a80d926ca0bb35577761cabee2d13c.tar.gz
yuzu-b492d43e63a80d926ca0bb35577761cabee2d13c.tar.xz
yuzu-b492d43e63a80d926ca0bb35577761cabee2d13c.zip
thread: Remove unnecessary memset from ResetThreadContext()
Regular value initialization is adequate here for zeroing out data. It also has the benefit of not invoking undefined behavior if a non-trivial type is ever added to the struct for whatever reason.
-rw-r--r--src/core/hle/kernel/thread.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 33aed8c23..352ce1725 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -183,13 +183,10 @@ void Thread::ResumeFromWait() {
183 */ 183 */
184static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top, 184static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top,
185 VAddr entry_point, u64 arg) { 185 VAddr entry_point, u64 arg) {
186 memset(&context, 0, sizeof(Core::ARM_Interface::ThreadContext)); 186 context = {};
187
188 context.cpu_registers[0] = arg; 187 context.cpu_registers[0] = arg;
189 context.pc = entry_point; 188 context.pc = entry_point;
190 context.sp = stack_top; 189 context.sp = stack_top;
191 context.pstate = 0;
192 context.fpcr = 0;
193} 190}
194 191
195ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name, VAddr entry_point, 192ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name, VAddr entry_point,