Skip to content

Structural and Memory Safety Improvements, Analyzer Cleanup

MrKev requested to merge mrkev/ryujinx:cleanup into master

Summary

This PR introduces structural improvements, enhanced memory safety, and code cleanups throughout the codebase.

Changes

  • Applied LayoutKind.Sequential to many structs, including the Array series (Array1<T> to Array384<T>), to ensure predictable memory layout. This is critical for correctness, as the project heavily relies on Unsafe.As for low-level memory manipulation.
  • Refactored methods to static in the SupervisorCall namespace.
  • Improved memory safety in SDL2HardwareDeviceDriver.
  • Refactored Buffer16 and updated BitStream128 usage.
  • Simplified ReadAsync parameters in Updater.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 ran dotnet format.
  • Updated .editorconfig for consistent code style (including this 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

Merge request reports

Loading