Add Roslyn analyzer and code fix for unique ownership
Some checks failed
Publish NuGet Packages / publish (pull_request) Has been cancelled

Introduce a Roslyn analyzer to enforce unique ownership semantics for structs marked with the `[NonCopyable]` attribute. Added a corresponding code fix to resolve violations by suggesting the use of `Share()` or other ownership transfer methods.

Key changes:
- Added `StructCopyCodeAnalyzer` to detect invalid struct copies.
- Implemented `StructCopyCodeFixProvider` to provide code fixes.
- Created `Misaki.HighPerformance.Analyzer` and `CodeFixes` projects.
- Added unit tests for the analyzer and code fixes.
- Introduced `UniquePtr<T>` and `SharedPtr<T>` for pointer ownership.
- Added a Visual Studio extension project and packaging support.
- Updated `UnsafeUtility` to use `nint`/`nuint` for indices.
This commit is contained in:
2025-11-22 18:20:03 +09:00
parent c0a0861897
commit 27dfa67784
34 changed files with 2122 additions and 26 deletions

View File

@@ -0,0 +1,6 @@
namespace Misaki.HighPerformance.LowLevel;
[AttributeUsage(AttributeTargets.Struct)]
public class NonCopyableAttribute : Attribute
{
}