Free method

  1. @override
void Free(
  1. String key
)
override

Frees the native memory owned by slot key and removes it from the table.

Throws if key has not been allocated.

Implementation

@override
void Free(String key) {
  if (!_StringSlotsKeyed.containsKey(key)) {
    throw StateError('[FREE] Cannot free unallocated String slot $key');
  }

  int slot = _StringSlotsKeyed[key]!;
  calloc.free(_StringSlots[slot]);
  _StringSlotsKeyed.remove(key);
  _StringSlots.removeAt(slot);
  _StringCapacities.removeAt(slot);
}