Commit Graph

644 Commits

Author SHA1 Message Date
henrik karlsson
4a36cfe8ff Moved operator== to be hidden friend instead of put directly in global namespace
Moved GetTypeHash function to be hidden friend instead of put directly in global namespace.

Note that the function/operator needs to be fully inlined in the type or placed in the cpp. If the function is added as friend but then implemented outside the type then hidden friend optimization won't work.

This should improve compile time somewhat according to msvc devs.

#rb Steve.Robb
#preflight 6360b7052b5338aceb26471b

[CL 22889837 by henrik karlsson in ue5-main branch]
2022-11-01 15:50:27 -04:00
Stephen Holmes
aa8997ef01 AI Truncation warning fixes.
This is the majority of the fixes however a few systems have been left for individual CLs.

#jira UE-166285
#preflight 63616567ce676ae868034ab0
#review-22869010

[CL 22889316 by Stephen Holmes in ue5-main branch]
2022-11-01 15:32:27 -04:00
steve robb
5bbc445002 Improved comments for unusual backwards-searching behavior in FString::Find.
#rb james.hopkin
#preflight none

[CL 22888649 by steve robb in ue5-main branch]
2022-11-01 15:09:46 -04:00
Graeme Thornton
fb828e81a5 Fix for hololens compilation after backing out a big TSet/TMap change
#rb steve.robb
#preflight 635d185c3c0af539fd87d974

[CL 22851418 by Graeme Thornton in ue5-main branch]
2022-10-29 08:30:53 -04:00
henrik karlsson
27d174fc9f Fixes to make code compliant with header units
#preflight 635c4bbd0e7b78e504cde2a9
#rb none

[CL 22850787 by henrik karlsson in ue5-main branch]
2022-10-29 03:00:24 -04:00
graeme thornton
e7986ac620 [Backout] - CL22808749
[FYI] Steve.Robb
Original CL Desc
-----------------------------------------------------------------
TMap and TSet can now be declared as members with forward-declared key and value parameters.
KeyFuncs::KeyInitType and KeyFuncs::ElementInitType typedefs are no longer used and user-defined KeyFuncs do not need to provide them.  Deprecated placeholders for these typedefs exist though they may not be defined exactly as they were before.  A new KeyType typedef needs to be provided by custom KeyFuncs which don't already inherit from BaseKeyFuncs or TDefaultMapKeyFuncs.
KeyConstPointerType, KeyInitType, ValueInitType and ElementInitType typedefs have been deprecated across TMap, TSet and TSortedMap.  Regular C++ parameter-passing semantics should be used instead (const T& Ref or T Value, depending on T).
Added missing FSetElementId::operator!=().

[FYI] steve.robb
#rb james.hopkin
[FYI] henrik.karlsson
#preflight 635a56c15d49a96f7b31938f

[CL 22850782 by graeme thornton in ue5-main branch]
2022-10-29 02:59:59 -04:00
Steve Robb
edfd95da58 Fix for the fix in CL# 22824506.
#rb trivial
#jira none
#preflight none

[CL 22824541 by Steve Robb in ue5-main branch]
2022-10-28 03:00:47 -04:00
Steve Robb
f50b601886 Possible fix for new VS2022 toolchain error.
#rb trivial
#jira none
#preflight none

[CL 22824506 by Steve Robb in ue5-main branch]
2022-10-28 02:59:38 -04:00
zach bethel
27cd761297 Fixed leaks in LockFreeList implementation.
#rb Danny.Couture
#jira UE-167008

[CL 22823596 by zach bethel in ue5-main branch]
2022-10-28 00:34:03 -04:00
steve robb
e980405a8f TMap and TSet can now be declared as members with forward-declared key and value parameters.
KeyFuncs::KeyInitType and KeyFuncs::ElementInitType typedefs are no longer used and user-defined KeyFuncs do not need to provide them.  Deprecated placeholders for these typedefs exist though they may not be defined exactly as they were before.  A new KeyType typedef needs to be provided by custom KeyFuncs which don't already inherit from BaseKeyFuncs or TDefaultMapKeyFuncs.
KeyConstPointerType, KeyInitType, ValueInitType and ElementInitType typedefs have been deprecated across TMap, TSet and TSortedMap.  Regular C++ parameter-passing semantics should be used instead (const T& Ref or T Value, depending on T).
Added missing FSetElementId::operator!=().

#rb james.hopkin
[FYI] henrik.karlsson
#preflight 635a56c15d49a96f7b31938f

[CL 22810695 by steve robb in ue5-main branch]
2022-10-27 11:20:32 -04:00
steve robb
4a33da509f Replaced the OOM in TArray::OnInvalidNum() with a UE_LOG(Fatal).
#rb elizabeth.bunner
#jira none
#preflight 635824a97a09a4c1bc474e3d

[CL 22793162 by steve robb in ue5-main branch]
2022-10-26 17:33:46 -04:00
steve robb
340221a930 Security guards for TArray.
#rb Devin.Doucette
#jira UE-166506
#preflight 635159369203f159e5a8e75b

[CL 22670299 by steve robb in ue5-main branch]
2022-10-20 16:39:24 -04:00
pj kack
7a12aa6728 TSet & TMap: Make sure any dynamic hash allocation is released when Empty() is called without additional slack.
Memory improvements on top of performance improvements in 11535961.
Allow the hash allocation to shrink for calls to Empty(), Shrink(), Compact() and CompactStable().
Let TSparseArray::Compact() shrink the data array just as for Shrink() and CompactStable().
Note: The private function TSet::ShouldRehash() is only called from Empty() and ConditionalRehash(), and ConditionalRehash() with bAllowShrinking=true is only called from Relax() via Shrink(), so there should be no impact on other/growth scenarios.
Modify GetAllocatedSize() for TSet, TMap and TSparseArray to only return any dynamically allocated size from the underlying allocators and change return type from uint32 to SIZE_T (just as for TArray and FContainerAllocatorInterface).

#rb johan.torp,steve.robb
#preflight 634952f4ce524ed356dafde7, 63496f80f622f6c4bb1c0321, 634d65df9c29024c982ecf26

[CL 22595144 by pj kack in ue5-main branch]
2022-10-18 04:03:13 -04:00
justin marcus
0f233e92a9 Fix emplace failing to deduce initializer lists.
[REVIEW] [at]Steve.Robb
#jira
#preflight https://horde.devtools.epicgames.com/job/634da2ac3d74ebc73856b6e8

[CL 22588999 by justin marcus in ue5-main branch]
2022-10-17 20:10:22 -04:00
Andriy Tylychko
3dbc65b2e3 fixed a race reported and analysed by Carl-Magnus Nordin:
T1: Tail.Store(Sentinel)
T2: Prev = Tail.Load()  (Prev = Sentinel)
T2: Prev.Next = [some node]  (Sentinel.Next = [some node])
T1: Sentinel.Next = null
which can lead to losing nodes
#preflight 63458fbf045315f96a1c53a2

[CL 22459506 by Andriy Tylychko in ue5-main branch]
2022-10-11 12:08:34 -04:00
Andriy Tylychko
961fe71486 removed a "check" because it relies on an insufficiently strict memory order ("release" on the previous line). reported by TSAN. the check is not important enough to pessimise the algo for it
#preflight 63400abec6753f31ce64995f

[CL 22398554 by Andriy Tylychko in ue5-main branch]
2022-10-07 07:35:20 -04:00
francis hurteau
566969db68 Revert useless change in cl 22233912
#rb trivial
#jira none
#preflight 63373edef76de2d4d5c5195b

[CL 22284221 by francis hurteau in ue5-main branch]
2022-09-30 19:24:30 -04:00
francis hurteau
89da91bdfa Fixed static analysis failure with IncludeTool on legit nested namespace declaration
[FYI] Steve.Robb
#rb trivial
#preflight 6334c71e691c0168b71ce55c

[CL 22240765 by francis hurteau in ue5-main branch]
2022-09-28 22:31:48 -04:00
Dave Belanger
453d3b16dd UE::Core::FVersePath added.
New asset tag added for vpaths, displayed in the content browser.

#rb dave.belanger
#preflight 63330acea4769ad714f8ea2d

[CL 22228539 by Dave Belanger in ue5-main branch]
2022-09-28 15:09:48 -04:00
steven barnett
a22d0f38f4 Allow TSparseArray resize via EmplaceAt.
This is a part of a larger change, 21332740, which fixes TSparseArray::EmplaceAt, which is needed for physics user data.

Slack discussion here: https://epic.slack.com/archives/C024GKBSL/p1663795752638719

[FYI] ian.fox

[CL 22151140 by steven barnett in ue5-main branch]
2022-09-22 22:20:25 -04:00
marti majo
ca82ed87c4 Fixing bug where LruCache::FindByPredicate and PsoLruCache::FindByPredicate are not returning a pointer but a value when an item is found.
[REVIEW] [at]Geoffrey.Wong [at]Derek.Peterson [at]Paul.Moore [at]Michael.Mackie [at]Philip.Buuck

[CL 22100282 by marti majo in ue5-main branch]
2022-09-20 15:40:08 -04:00
richard talbotwatkin
5a595e0092 Fixed issue with TArray::BulkSerialize, when the buffer size can exceed 2Gb.
Even if the array index type is int32, the data buffer can exceed 2Gb.
BulkSerialize requires a cast to ensure the result of NewArrayNum * SerializedElementSize is a 64-bit value.
This should not adversely affect assets previously serialized with BulkSerialize: when saving (but not cooking), the slow path is taken, meaning all the data will be written out correctly.
During cooking and transacting (less permanent operations), the data would have been written and read equally erroneously, so recooking may be required.
#rb Steve.Robb, Robert.Manuszewski, Matt.Peters
#preflight 632490273752284a31829815

[CL 22052384 by richard talbotwatkin in ue5-main branch]
2022-09-16 12:48:51 -04:00
Devin Doucette
2d6866d2ec DDC: Set UnsafeTypeCastWarningLevel to Error
#preflight 631907e2a20b67673b513de6
#rb Zousar.Shaker
#rnx

[CL 21871353 by Devin Doucette in ue5-main branch]
2022-09-07 22:45:29 -04:00
Devin Doucette
27eed0a0bd Array: Fixed unsafe type cast warnings when moving from an array with a larger size type
#preflight 6317fab1304480f8f8ee3e31
#rb Steve.Robb

[CL 21850748 by Devin Doucette in ue5-main branch]
2022-09-07 10:36:40 -04:00
elias lozadabenavent
b4e72ed6c6 Updated TPagedArray:
* Added Append/Assign std::initializer_list overloads.
* Implemented std::initializer_list assignment operator overload in term of Assign.
* Fixed Append debug assertion: it now properly uses Reserve instead of Grow: added a comment to Grow as this method expects the container capacity to be smaller than the value requested.
* Added unit tests for both Append and Emplace that force the container to Grow.

#tests passed PagedArray unit test in Debug and Test: verified no assertions are triggered.

#preflight 6315db24ab25bb91f5dc10d3

#rb steve.robb

[CL 21801519 by elias lozadabenavent in ue5-main branch]
2022-09-05 15:34:01 -04:00