dispose method

void dispose()

Deterministically frees the native resource and detaches the GC finalizer.

Safe to call multiple times (subsequent calls are no-ops).

Implementation

void dispose() {
  if (_disposed) return;
  _disposed = true;
  _finalizer.detach(this);
  _rawFree(_ptr.cast());
}