Structural and Memory Safety Improvements, Analyzer Cleanup
Summary
This PR introduces structural improvements, enhanced memory safety, and code cleanups throughout the codebase.
Changes
- Applied
LayoutKind.Sequential
to many structs, including theArray
series (Array1<T>
toArray384<T>
), to ensure predictable memory layout. This is critical for correctness, as the project heavily relies onUnsafe.As
for low-level memory manipulation. - Refactored methods to
static
in theSupervisorCall
namespace. - Improved memory safety in
SDL2HardwareDeviceDriver
. - Refactored
Buffer16
and updatedBitStream128
usage. - Simplified
ReadAsync
parameters inUpdater.cs
. - Refactored update method for async downloads.
- Removed unused variables and unnecessary
this
qualifiers. - Eliminated extra blank lines and multiple warning pragmas.
- Cleaned up
using
directives and randotnet format
. - Updated
.editorconfig
for consistent code style (includingthis
usage).
Outstanding Issues
There are currently 4 warnings related to the use of unsafe TLS versions remain.
Resolving these would require changes that may be subjective or not universally agreed upon.
Benefits
- Improved code clarity, performance, and memory safety.
- More consistent and maintainable codebase.
- Better alignment with modern C# practices and interop standards.
Edited by MrKev