Ryujinx/Ryujinx.Common/Memory
jhorv 5131b71437
Reducing memory allocations (#4537)
* add RecyclableMemoryStream dependency and MemoryStreamManager

* organize BinaryReader/BinaryWriter extensions

* add StreamExtensions to reduce need for BinaryWriter

* simple replacments of MemoryStream with RecyclableMemoryStream

* add write ReadOnlySequence<byte> support to IVirtualMemoryManager

* avoid 0-length array creation

* rework IpcMessage and related types to greatly reduce memory allocation by using RecylableMemoryStream, keeping streams around longer, avoiding their creation when possible, and avoiding creation of BinaryReader and BinaryWriter when possible

* reduce LINQ-induced memory allocations with custom methods to query KPriorityQueue

* use RecyclableMemoryStream in StreamUtils, and use StreamUtils in EmbeddedResources

* add constants for nanosecond/millisecond conversions

* code formatting

* XML doc adjustments

* fix: StreamExtension.WriteByte not writing non-zero values for lengths <= 16

* XML Doc improvements. Implement StreamExtensions.WriteByte() block writes for large-enough count values.

* add copyless path for StreamExtension.Write(ReadOnlySpan<int>)

* add default implementation of IVirtualMemoryManager.Write(ulong, ReadOnlySequence<byte>); remove previous explicit implementations

* code style fixes

* remove LINQ completely from KScheduler/KPriorityQueue by implementing a custom struct-based enumerator
2023-03-17 13:14:50 +01:00
..
PartialUnmaps chore: Update tests dependencies (#3978) 2023-01-01 17:35:29 +01:00
ArrayPtr.cs Rename ToSpan to AsSpan (#3556) 2022-08-11 18:07:37 -03:00
Box.cs time: Make TimeZoneRule blittable and avoid copies (#3361) 2022-06-24 19:04:57 +02:00
IArray.cs New NVDEC and VIC implementation (#1384) 2020-07-12 05:07:01 +02:00
MemoryStreamManager.cs Reducing memory allocations (#4537) 2023-03-17 13:14:50 +01:00
Ptr.cs New NVDEC and VIC implementation (#1384) 2020-07-12 05:07:01 +02:00
SpanOrArray.cs Make structs readonly when applicable (#4002) 2022-12-05 14:47:39 +01:00
SpanReader.cs IPC refactor part 3+4: New server HIPC message processor (#4188) 2023-01-04 23:15:45 +01:00
SpanWriter.cs IPC refactor part 3+4: New server HIPC message processor (#4188) 2023-01-04 23:15:45 +01:00
StructArrayHelpers.cs Rename ToSpan to AsSpan (#3556) 2022-08-11 18:07:37 -03:00
StructByteArrayHelpers.cs Rename ToSpan to AsSpan (#3556) 2022-08-11 18:07:37 -03:00