UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RaceDetectorPlatform.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
7#if USING_INSTRUMENTATION
8
9#include "CoreTypes.h"
10
11namespace UE::Sanitizer::RaceDetector {
12 namespace Platform {
13 // Performs any platform specific initialization.
14 bool InitializePlatform();
15 // Performs any platform specific cleanup.
16 bool CleanupPlatform();
17 // Prepare address space of shadow memory
18 void InitShadowMemory();
19 // Returns the command line the process was started with.
20 const TCHAR* GetCommandLine();
21 // Returns the page size granularity.
22 UPTRINT GetPageSize();
23 // Returns the base address of the shadow memory address space.
24 // Note: InitShadowMemory must have been called before, otherwise this is meaningless.
26 // Returns the size of the entire shadow memory address space.
27 // Note: InitShadowMemory must have been called before, otherwise this is meaningless.
29 // Get the base of the shadow memory for clock banks.
31 // Returns the number of bytes currently mapped in the shadow memory.
33 // Returns whether a particular range is already accessible in shadow memory.
35 // Maps a range in shadow memory so that it is safe to access.
37 // Unmaps the entire range of shadow memory.
38 void UnmapShadowMemory();
39 // Returns whether a debugger is currently attached to our process.
40 bool IsDebuggerPresent();
41 // Returns whether there is any page currently mapped in shadow memory.
43 // Sends a hint to visual studio to hide first chance exception to reduce noise caused by shadow memory access.
45 // Sleeps for the given amount of milliseconds.
47 // Capture the current callstack.
48 uint16 CaptureStackBackTrace(uint32 FrameToSkip, uint32 FrameToCapture, void** Backtrace);
49 // Allocates a Tls index.
50 uint32 AllocTlsSlot();
51 // Releases a Tls index.
52 void FreeTlsSlot(uint32 Index);
53 // Gets the value of the Tls index for the current thread.
54 void* GetTlsValue(uint32 Index);
55 // Sets the value of the Tls index for the current thread.
56 void SetTlsValue(uint32 Index, void* Value);
57 // Returns the current thread Id.
59
60 // Rewrites the patchable function prefix with the proper jmp to the target.
62 // Rewrites the patchable function prefix back to its original compiled NOPs.
64 // Rewrites the 2 first bytes of the function to jump at the beginning of the prefix section.
66 // Rewrites the 2 first bytes of the function to either do nothing or do an immediate return (RET bypass).
68 // This needs to be called after trampoline activation or deactivation to make sure it takes effect immediately.
70 // Get the limits of the stack for the current thread.
72 // Check if the thread id given is currently alive
73 bool IsThreadAlive(uint32 ThreadId);
74 // Provides a compilation barrier
75 FORCEINLINE void AsymmetricThreadFenceLight()
76 {
78 }
79
80 // The function generates an interprocessor interrupt (IPI) to all processors that are part of the current process affinity.
81 // It guarantees the visibility of write operations performed on one processor to the other processors.
82 void AsymmetricThreadFenceHeavy();
83 }
84}
85
86#endif // USING_INSTRUMENTATION
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::UPTRINT UPTRINT
An unsigned integer the same size as a pointer.
Definition Platform.h:1146
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Milliseconds
uint32 Size
Definition VulkanMemory.cpp:4034
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
bool IsThreadAlive(const void *p_os_thread_mem)
MINIMAL_WINDOWS_API DWORD WINAPI GetCurrentThreadId()
bool IsDebuggerPresent()
Definition LinuxCommon.h:33
U16 Index
Definition radfft.cpp:71