sizeOf method

  1. @override
int sizeOf([
  1. int valueSizeInBytes = 0
])
inherited

Return approximate size of tree in bytes

Not exact but provides useful comparison between different instances of TTMultiMap.

If size of value type should be included in calculation then specify size via valueSizeInBytes.

Implementation

@override
int sizeOf([int valueSizeInBytes = 0]) {
  final root = _root;
  if (identical(root, null)) {
    return 0;
  }

  // String pool size
  var poolSize = sizeOfPool(_runePool);

  // get tree size
  return (4 * SIZE_OF_REF) + poolSize + _sizeOfTree(root, valueSizeInBytes);
}