cpfuo.AuditAggressiveReferenceReplacment
cpfuo.AuditAggressiveReferenceReplacment
#Overview
name: cpfuo.AuditAggressiveReferenceReplacment
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to audit and report on reference replacements that come from the aggressive replacement path.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of cpfuo.AuditAggressiveReferenceReplacment is to control whether the Unreal Engine should audit and report on reference replacements that come from the aggressive replacement path. This setting is primarily used for debugging and performance optimization in the object property copying system.
This setting variable is used in the Engine module, specifically within the object property copying functionality. It is primarily referenced in the UEngine class, which is a core part of the Unreal Engine runtime.
The value of this variable is set as a console variable, which means it can be modified at runtime through the console or configuration files. By default, it is set to 1 (true).
This variable interacts closely with another console variable named CVarUseAggressiveReferenceReplacement. While cpfuo.AuditAggressiveReferenceReplacment controls the auditing and reporting, CVarUseAggressiveReferenceReplacement determines whether the aggressive reference replacement should be used at all.
Developers should be aware that this variable is marked with ECVF_Cheat flag, indicating it’s intended for debugging and testing purposes, not for use in shipping builds. It’s also important to note that the auditing functionality is completely disabled in shipping builds, regardless of this setting.
Best practices when using this variable include:
- Using it primarily during development and testing phases.
- Combining it with CVarUseAggressiveReferenceReplacement to get a full picture of the aggressive reference replacement behavior.
- Being cautious about enabling it in performance-critical scenarios, as auditing can introduce overhead.
Regarding the associated variable CVarAuditAggressiveReferenceReplacement:
The purpose of CVarAuditAggressiveReferenceReplacement is the same as cpfuo.AuditAggressiveReferenceReplacment. It’s an internal representation of the console variable within the C++ code.
This variable is used in the Engine module, specifically within the UEngine::CopyPropertiesForUnrelatedObjects function. It’s used to determine whether to perform auditing of aggressive reference replacements.
The value of this variable is set by the console variable system based on the cpfuo.AuditAggressiveReferenceReplacment setting.
It interacts directly with CVarUseAggressiveReferenceReplacement to determine the behavior of aggressive reference replacement and its auditing.
Developers should be aware that this variable is only checked in non-shipping builds. In shipping builds, auditing is always disabled for performance reasons.
Best practices for using this variable include:
- Using it in conjunction with logging or breakpoints to investigate unexpected behavior in object property copying.
- Being mindful of its performance impact when enabled.
- Ensuring it’s not relied upon in shipping code, as it won’t have any effect in those builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:17136
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarAuditAggressiveReferenceReplacement(
TEXT("cpfuo.AuditAggressiveReferenceReplacment"),
1,
TEXT("Whether to audit and report on reference replacements that come from the aggressive replacement path.\n"),
ECVF_Cheat);
TAutoConsoleVariable<bool> CVarUseAggressiveReferenceReplacement(
TEXT("cpfuo.UseAggressiveReferenceReplacment"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarAuditAggressiveReferenceReplacement
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:17135
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarAuditAggressiveReferenceReplacement(
TEXT("cpfuo.AuditAggressiveReferenceReplacment"),
1,
TEXT("Whether to audit and report on reference replacements that come from the aggressive replacement path.\n"),
ECVF_Cheat);
TAutoConsoleVariable<bool> CVarUseAggressiveReferenceReplacement(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:17280
Scope (from outer to inner):
file
function void UEngine::CopyPropertiesForUnrelatedObjects
Source code excerpt:
#if !UE_BUILD_SHIPPING
PRAGMA_DISABLE_DEPRECATION_WARNINGS
const bool bAuditAggressiveReplacement = Params.bAggressiveDefaultSubobjectReplacement && CVarAuditAggressiveReferenceReplacement.GetValueOnAnyThread();
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#else
constexpr bool bAuditAggressiveReplacement = false;
#endif
const bool bDoAggressiveReplacement = CVarUseAggressiveReferenceReplacement.GetValueOnAnyThread();