What problem does it solve?
This Skill prevents native container lifetime bugs and managed allocation “GC bombs” in Unity DOTS/Hybrid code paths, reducing editor exceptions and hard-to-debug memory leaks.
Core Features & Use Cases
- Allocator lifetime correctness: Ensures
Allocator.Persistent allocations always have matching Dispose() in the proper lifecycle hook (OnDestroy / state.Dispose-bound fields).
- Job-safe container usage: Enforces rules around passing
NativeArray between main thread and jobs, resizing patterns, and correct usage of parallel writers.
- GC-avoidance in hot paths: Flags managed allocation anti-patterns in
OnUpdate (string interpolation/formatting, LINQ, boxing, dictionary writes) and provides DOTS-native replacements.
- Blob asset best practices: Guides read-only long-lived data via
BlobAssetReference<T> built once and never mutated.
Quick Start
Use the memory-safety skill to audit your Unity DOTS/Hybrid system for Allocator.Persistent leaks and hot-path GC allocations before you ask for verifier-level performance and safety checks.