static void CheckForLeaks() { int leaks = MemoryOwner.LeakCount <byte>(); if (leaks != 0) { throw new InvalidOperationException($"Failed to dispose {leaks} byte-leases"); } }