Avoid storing the Tcb pointer on the stack (#3819)

* Avoid storing the Tcb pointer on the stack

* Just return the already stored pointer in GetTcbBase

* Replace uses of GetTcbBase with g_curthread->tcb

* copyright 2025

* sir clang offnir, the all-formatting
This commit is contained in:
kalaposfos13
2025-11-21 09:42:49 +01:00
committed by GitHub
parent 544a22a431
commit 56109a1331
4 changed files with 8 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -36,9 +36,6 @@ u32 GetTcbKey();
/// Sets the data pointer to the TCB block.
void SetTcbBase(void* image_address);
/// Retrieves Tcb structure for the calling thread.
Tcb* GetTcbBase();
/// Makes sure TLS is initialized for the thread before entering guest.
void EnsureThreadInitialized();