Search Issue Tracker

By Design

Votes

0

Found in

2017.3.0f3

Issue ID

993826

Regression

No

List.Sort(System.Comparison<T> comparison) generates garbage

Mono

-

Steps to reproduce:
1. Open attached “ListSortGCAllocTest.zip” Unity project
2. Open “ListSortGCAllocTest” scene
3. Open Window->Profiler
4. Enable Record and Deep Profile in Profiler window
5. Enter Play mode
-Notice that garbage is generated in Update.ScriptRunBehaviourUpdate by ListSortGCAllocTest.SortComparison() method

Expected results:
No garbage is generated by List.Sort(Comparison<T> comparison) and GC Alloc is 0 B
Actual results:
Garbage is generated by List.Sort(Comparison<T> comparison) and GC Alloc >0 B

Reproduced in: 2018.2.0a1, 2018.1.0b5, 2017.3.1f1, 2017.2.1p3, 2017.1.3p1, 2017.1.0a1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.