memorySize method

int memorySize(
  1. T instance
)

Estimates memory usage of instance.

Implementation

int memorySize(T instance) {
  final builder = MemoryCounter();
  memorySizeWith(builder, instance);
  return builder.memoryUsageInBytes;
}