mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-08 20:58:41 +00:00
Fix Pthread memset warning and add comment. (#3625)
This commit is contained in:
@@ -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