public CallbackData(CounterVisitor visitor, int bufferSize) { this.visitor = visitor; array = ArrayPool <byte> .Shared.Rent(bufferSize); gch = GCHandle.Alloc(this); }
public void Dump(CounterVisitor visitor) { using var data = new CallbackData(visitor, bufferSize); Native.mono_counters_foreach(cb, data.Handle); }