check method

void check()

Checks for memory corruption and throws an error if detected.

Implementation

void check() {
  if (_start.value != _guardValue) {
    throw StateError('Memory corruption detected at start of $_debugName');
  }
  if (_end.value != _guardValue) {
    throw StateError('Memory corruption detected at end of $_debugName');
  }
}