Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEXCore: Constify CTX ptr in InternalThreadState #4180

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FEXCore/Source/Interface/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,6 @@ void ContextImpl::InitializeCompiler(FEXCore::Core::InternalThreadState* Thread)

Dispatcher->InitThreadPointers(Thread);

Thread->CTX = this;

Thread->PassManager->AddDefaultPasses(this);
Thread->PassManager->AddDefaultValidationPasses();

Expand All @@ -410,7 +408,9 @@ void ContextImpl::InitializeCompiler(FEXCore::Core::InternalThreadState* Thread)

FEXCore::Core::InternalThreadState*
ContextImpl::CreateThread(uint64_t InitialRIP, uint64_t StackPointer, const FEXCore::Core::CPUState* NewThreadState, uint64_t ParentTID) {
FEXCore::Core::InternalThreadState* Thread = new FEXCore::Core::InternalThreadState {};
FEXCore::Core::InternalThreadState* Thread = new FEXCore::Core::InternalThreadState {
.CTX = this,
};

Thread->CurrentFrame->State.gregs[X86State::REG_RSP] = StackPointer;
Thread->CurrentFrame->State.rip = InitialRIP;
Expand Down
2 changes: 1 addition & 1 deletion FEXCore/include/FEXCore/Debug/InternalThreadState.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct InternalThreadState : public FEXCore::Allocator::FEXAllocOperators {
std::atomic_bool ThreadSleeping {false};
} RunningEvents;

FEXCore::Context::Context* CTX;
FEXCore::Context::Context* const CTX;

NonMovableUniquePtr<FEXCore::Threads::Thread> ExecutionThread;
bool StartPaused {false};
Expand Down
Loading