Skip to content

Commit 70d5193

Browse files
authored
Merge pull request #20775 from davkean/RemoveAllocation
Remove capture allocation from WriteArray
2 parents de8b37a + 4011a79 commit 70d5193

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Compilers/Core/Portable/Serialization/ObjectWriter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ private void WriteArray(Array array)
484484
// don't blow the stack. 'LongRunning' ensures that we get a dedicated thread
485485
// to do this work. That way we don't end up blocking the threadpool.
486486
var task = Task.Factory.StartNew(
487-
() => WriteArrayValues(array),
487+
a => WriteArrayValues((Array)a),
488+
array,
488489
_cancellationToken,
489490
TaskCreationOptions.LongRunning,
490491
TaskScheduler.Default);

0 commit comments

Comments
 (0)