UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AutoRTFMConstants.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5// WARNING: Any change in these constants will require a re-patch and re-build of LLVM!
6
7#ifdef __cplusplus
8#include <cstdint>
9
10extern "C"
11{
12#endif
13
14// An enumerator of transactional memory validation levels.
15// Memory validation is used to detect modification by open-code to memory that was written by a
16// transaction. In this situation, aborting the transaction can corrupt memory as the undo will
17// overwrite the writes made in the open-code.
18typedef enum
19{
20 // Use the default memory validation level.
22
23 // Disable memory validation.
25
26 // Enable memory validation. Memory validation failures are treated as warnings.
28
29 // Enable memory validation. Memory validation are treated as fatal.
32
33#ifdef __cplusplus
34}
35#endif
36
37#ifdef __cplusplus
38namespace AutoRTFM::Constants
39{
40 inline constexpr uint32_t Major = 0;
41 inline constexpr uint32_t Minor = 2;
42 inline constexpr uint32_t Patch = 0;
43
44 // The Magic Prefix constant - an arbitrarily chosen address prefix, shared
45 // between the AutoRTFM compiler and runtime.
46 // We add this prefix value to open function pointer addresses in our custom
47 // LLVM pass. At runtime, if we detect the Magic Prefix in the the top 16 bits
48 // of an open function pointer address, we assume that we can find a closed
49 // variant pointer residing 8 bytes before the function address.
50 inline constexpr uint64_t MagicPrefix = 0xa273'0000'0000'0000;
51 // Similar to the above, but these constants indicate that the low 48 bits
52 // provide a relative addresses from the open function to the closed
53 // function.
54 inline constexpr uint64_t PosOffsetMagicPrefix = 0xa272'0000'0000'0000;
55 inline constexpr uint64_t NegOffsetMagicPrefix = 0xa271'0000'0000'0000;
56
57} // namespace AutoRTFM::Constants
58#endif
autortfm_memory_validation_level
Definition AutoRTFMConstants.h:19
@ autortfm_memory_validation_level_warn
Definition AutoRTFMConstants.h:27
@ autortfm_memory_validation_level_error
Definition AutoRTFMConstants.h:30
@ autortfm_memory_validation_level_default
Definition AutoRTFMConstants.h:21
@ autortfm_memory_validation_level_disabled
Definition AutoRTFMConstants.h:24
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Patch
Patch version increments fix existing functionality without changing the API.
@ Major
Major version increments introduce breaking API changes.
@ Minor
Minor version increments add additional functionality without breaking existing APIs.