Google is committed to advancing racial equity for Black communities. See how.

claimMemory method

*<Null safety>*

int claimMemory (int size, int nextOutOfLineDepth)

Implementation

int claimMemory(int size, int nextOutOfLineDepth) {
  if (nextOutOfLineDepth > _maxOutOfLineDepth) {
    throw FidlError('Exceeded maxOutOfLineDepth',
        FidlErrorCode.fidlExceededMaxOutOfLineDepth);
  }
  final int result = _nextOffset;
  _nextOffset += _align(size);
  if (_nextOffset > data.lengthInBytes) {
    throw FidlError('Cannot access out of range memory');
  }
  return result;
}