mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-11-17 19:44:36 +01:00
Fix Pthread memset warning and add comment. (#3625)
This commit is contained in:
1 parent
71e81c836c
commit
be80276ec3
1 file changed
+3
-1
@@ -100,7 +100,9 @@ Pthread* ThreadState::Alloc(Pthread* curthread) {
|
||||
tcb = TcbCtor(thread, 1 /* initial tls */);
|
||||
}
|
||||
if (tcb != nullptr) {
|
||||
memset(thread, 0, sizeof(Pthread));
|
||||
// Initialize thread struct memory to 0. This is safe since it will be constructed
|
||||
// immediately after.
|
||||
std::memset(static_cast<void*>(thread), 0, sizeof(Pthread));
|
||||
std::construct_at(thread);
|
||||
thread->tcb = tcb;
|
||||
thread->sleepqueue = new SleepQueue{};
|
||||
|
||||
Reference in new issue
Block a user