Returns a monotonically increasing ID, used to generate unique slot keys.
int nextId() => _currentId++;