UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ContextInlines.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if (defined(__AUTORTFM) && __AUTORTFM)
6
7#include "Context.h"
9
10namespace AutoRTFM
11{
12
13UE_AUTORTFM_FORCEINLINE FContext* FContext::Get()
14{
15 return FContext::Instance;
16}
17
18AUTORTFM_NO_ASAN UE_AUTORTFM_FORCEINLINE void FContext::RecordWrite(void* LogicalAddress, size_t Size)
19{
21}
22
23template<unsigned SIZE> AUTORTFM_NO_ASAN UE_AUTORTFM_FORCEINLINE void FContext::RecordWrite(void* LogicalAddress)
24{
26 {
28 }
29 else
30 {
31 GetMaterializedTransaction()->RecordWrite<SIZE>(LogicalAddress);
32 }
33}
34
35template<unsigned SIZE> AUTORTFM_NO_ASAN UE_AUTORTFM_FORCENOINLINE void FContext::RecordWriteSlow(void* LogicalAddress)
36{
37 // Going through get current transaction will do the materialization of deferred transactions, but it is slow
38 // so that is why we use this carve out.
39 GetCurrentTransaction()->RecordWrite<SIZE>(LogicalAddress);
40}
41
42UE_AUTORTFM_FORCEINLINE void FContext::DidAllocate(void* LogicalAddress, size_t Size)
43{
45}
46
47UE_AUTORTFM_FORCEINLINE void FContext::DidFree(void* LogicalAddress)
48{
49 // We can do free's in the open within a transaction *during* when the
50 // transaction itself is being destroyed, so we need to check for that case.
51 FTransaction* Transaction = GetCurrentTransaction();
52 if (AUTORTFM_LIKELY(Transaction))
53 {
54 Transaction->DidFree(LogicalAddress);
55 }
56}
57
58UE_AUTORTFM_FORCEINLINE bool FContext::AttemptToCommitTransaction(FTransaction* const Transaction)
59{
60 AUTORTFM_ASSERT(EContextStatus::OnTrack == Status);
61
62 Status = EContextStatus::Committing;
63
64 const bool bResult = Transaction->AttemptToCommit();
65
66 if (bResult)
67 {
68 Status = EContextStatus::OnTrack;
69 }
70
71 return bResult;
72}
73
74} // namespace AutoRTFM
75
76#endif // (defined(__AUTORTFM) && __AUTORTFM)
#define UE_AUTORTFM_FORCENOINLINE
Definition AutoRTFMDefines.h:173
#define UE_AUTORTFM_FORCEINLINE
Definition AutoRTFMDefines.h:171
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32 Size
Definition VulkanMemory.cpp:4034
Definition API.cpp:57