- removed GMarkPropertiesSetBySerialization and added bTrackSerializedProperties flag to FUObjectSerializeContext to avoid race conditinons
#jira UE-217800
#rb Devin.Doucette
[CL 34385324 by jordan hoffmann in ue5-main branch]
- Renamed CreateUnknownPropertyTree to FindOrCreateUnknownPropertyTree.
- Fixed an edge case where the property can be set wrong on the property tag.
- Fixed an edge case where the wrong property can be recorded as initialized.
- Added a test for unknown property tracking.
#rb Francis.Hurteau
[CL 33983975 by devin doucette in ue5-main branch]
Change summary:
- Reduced IsObjectHandleTypeSafe() to just a simple bit test. The LSB must also be set to require that it's a packed ref.
- Modified ResolveObjectHandleNoRead()/ResolveObjectHandleNoReadNoCheck() to update the handle only if type safe.
- Modified ObjectPtr_Private::Get() to return NULL without first resolving the handle (for pointers bound to UObject subtypes).
- Modified FLinkerLoad::operator<<() to serialize placeholder-typed object references as an "unsafe" packed reference only if the pointer type is unsafe.
- Modified TObjectPtr::GetInternalRef() to assert if the handle is not resolved. This will catch an attempt to return an unsafe pointer as a packed reference.
- Modified ToRawPtrArrayUnsafe() to assert if any item in the array is not resolved. This will catch an attempt to treat a packed reference as the element type.
- Modified TContainerElementTypeCompatibility::ReinterpretRange()/ReinterpretRangeContiguous() to assert if any element of the pointer array is not resolved.
- Modified ToRawPtrTArrayUnsafe() to reinterpret the pointer array through the type compatibility layer to catch any attempt to treat a packed reference as the element type.
- Revised TObjectPtr natvis to reduce the placeholder intrinsic query down to just a single bit test.
- Removed 'GObjectIndexToPackedObjectRefDebug' as it is no longer required for natvis support.
- Revised FObjectHandle/TObjectPtr type safety unit tests to validate the unresolved state of placeholder-typed references as well as include invalid address inputs to ensure we're only using pointer semantics.
#jira UE-215308
#rb Francis.Hurteau, Zousar.Shaker
[CL 33975641 by phillip kavan in ue5-main branch]
Additional changes:
- Consolidated TObjectPtr natvis into a single visualizer block with an additional IsDerivedObjectType() intrinsic.
- Updated type safety unit test coverage to include 'const UObject' pointer types.
#jira UE-214693
#rb Francis.Hurteau, Zousar.Shaker
[CL 33643044 by phillip kavan in ue5-main branch]
Notes:
- This replaces the previous solution that relied on indirection.
- This solution relies on packed ref handles which requires late resolve features to also be enabled.
Change summary:
- Modified FPropertyBagRepository::IsPropertyBagPlaceholderType()/IsPropertyBagPlaceholderObject() to make the parameter read-only.
- Re-enabled UE_WITH_OBJECT_HANDLE_TYPE_SAFETY for the editor context. This will unblock testing of IDO w/ placeholder type features.
- Modified UE::CoreUObject::Private::Pack() to include a new "type" trait bit in the packed object handle reference. If set, it will signal that the reference is also a placeholder-typed object.
- Modified UE::CoreUObject::Private::MakePackedObjectRef() to include a check for whether or not the given object reference is also a placeholder-typed object, and allow this case to pass.
- Added UE::CoreUObject::Private::IsObjectHandleTypeSafeNoReadNoCheck(). This allows the implementation of IsObjectHandleTypeSafe() to rely on packed reference semantics, which are implemented as internal inline definitions.
- Modified FLinkerLoad serialization of FObjectPtr values to register a packed object reference mapping for placeholder-typed objects. Note: This requires late resolve features to also be enabled.
- Modified the TObjectPtr equality test to handle the case when only the RHS side is NULL. This can occur if the RHS is a non-UObject-type bound ptr to a placeholder object while the LHS is not.
- Revised all object handle/ptr unit tests for type safety. Ensured that TObjectPtr stress tests are still in line both with/without type safety enabled.
- Added a GObjectIndexToPackedObjectRefDebug global ptr to assist with debugger visualization of resolved placeholder-typed object references to allow for removal of RF_HasPlaceholderType.
- Updated VS natvis file to revise queries for IsPlaceholderObject() on non-UObject-typed TObjectPtr values (removed ObjectFlags check and replaced w/ GObjectIndexToPackedObjectRefDebug).
- Deprecated/removed all usage of RF_HasPlaceholderType (no longer required).
- Removed FPropertyBagRepository::PropertyBagPlaceholderTypeRegistry and decoupled the current (static) API from the repo singleton instance.
- (Minor) Fixed up some handle tracking unit tests in ObjectPropertyTest.cpp that did not compile with UE_WITH_OBJECT_HANDLE_LATE_RESOLVE disabled.
#jira UE-212508, UE-197358
#rb Zousar.Shaker
[CL 33397676 by phillip kavan in ue5-main branch]
- Add thread-safe ref-counting mecanism to UObject
- Make TStrongObjectPtr more light-weight and usable on any thread by using ref-count instead of FGCObject
- Add pinning API to WeakObjectPtr so they can be converted safely to StrongObjectPtr from any thread
- Make delegate broadcast thread-safe when used with UObjects by pinning during broadcast for non game-thread.
#jira UE-211624
#rb Robert.Manuszewski
[CL 33370596 by danny couture in ue5-main branch]
Fix FOptionalProperty flags to not set CPF_ZeroConstructor for inner types with intrusive unset states.
Make assignment of TOptional consistent between intrusive and non-intrusive types - always destroy and reconstruct the value. This allows TOptional<const T> to work correctly whether T is intrusive or not.
#rb Jamie.Dale, Johan.Torp
[CL 33214851 by robert millar in ue5-main branch]
Add new required FProperty methods HasIntrusiveUnsetOptionalState, InitializeOptionalIntrusive, IsOptionalSetIntrusive, ClearOptionalIntrusive.
Implement specific handling for not-null object pointers.
Defer to template function ::HasIntrusiveUnsetOptionalSate<T> for native struct types and types using cpp type fundamentals.
#rb Andrew.Scheidecker, Johan.Torp
[CL 33117302 by robert millar in ue5-main branch]
This type will replace FPropertyBag as a means of gathering unique property paths during package loading.
#jira UE-211461
#rb Francis.Hurteau
#rnx
[CL 32932117 by devin doucette in ue5-main branch]
Notes:
- For placeholder-typed objects, TObjectPtr<UObject> is considered to be type safe since placeholder types are based on UObject.
- This means we can avoid having to check for and indirectly resolve placeholders via the ptr's internal object handle in these cases.
#jira UE-209831
#rb Francis.Hurteau, Zousar.Shaker
[CL 32434610 by phillip kavan in ue5-main branch]
These are convenience functions that cover most usage of FPropertyTypeName outside of CoreUObject.
#rb Steve.Robb
#rnx
[CL 31949226 by devin doucette in ue5-main branch]
#rb Per.Larsson
#jira UE-207889
#rnx
- The FEditorBulkData tests should only run on platforms with WITH_EDITORONLY_DATA enabled, this was lost when moving them from automation tests.
- Fixed up some poorly formatted includes.
[CL 31834360 by paul chipchase in ue5-main branch]
We want to use these to contain object path names, for which () is invalid and <> is not technically invalid.
#rb Matt.Peters
#rnx
[CL 31660123 by devin doucette in ue5-main branch]