Lines Matching defs:chunk
166 Chunk& chunk = FindChunk(pos, stats);
167 size_t buffer_end = chunk.length;
168 size_t buffer_pos = std::min(buffer_end, pos - chunk.position);
169 return {&chunk.data.get()[buffer_pos], &chunk.data.get()[buffer_end]};
189 // Walk forwards while the position is in front of the current chunk.
550 // Position contains a StreamPosition and the index of the chunk the position
558 // A chunk in the list of chunks, containing:
559 // - The chunk data (data pointer and length), and
560 // - the position at the first byte of the chunk.
574 // Within the current chunk, skip forward from current_ towards position.
576 // Within the current chunk, fill the buffer_ (while it has capacity).
578 // Fetch a new chunk (assuming current_ is at the end of the current data).
597 const Chunk& chunk = GetChunk(current_.chunk_no);
598 DCHECK(current_.pos.bytes >= chunk.start.bytes);
600 unibrow::Utf8::State state = chunk.start.state;
601 uint32_t incomplete_char = chunk.start.incomplete_char;
602 size_t it = current_.pos.bytes - chunk.start.bytes;
603 const uint8_t* cursor = &chunk.data.get()[it];
604 const uint8_t* end = &chunk.data.get()[chunk.length];
630 current_.pos.bytes = chunk.start.bytes + (cursor - chunk.data.get());
644 const Chunk& chunk = GetChunk(current_.chunk_no);
654 // If the current chunk is the last (empty) chunk we'll have to process
656 if (chunk.length == 0) {
669 size_t it = current_.pos.bytes - chunk.start.bytes;
670 const uint8_t* cursor = chunk.data.get() + it;
671 const uint8_t* end = chunk.data.get() + chunk.length;
719 current_.pos.bytes = chunk.start.bytes + (cursor - chunk.data.get());
741 const uint8_t* chunk = nullptr;
742 size_t length = source_stream_->GetMoreData(&chunk);
743 chunks_->emplace_back(chunk, length, current_.pos);
762 // Search for the last chunk whose start position is less or equal to
769 // Did we find the terminating (zero-length) chunk? Then we're seeking
771 // Set current_ to point to the terminating chunk.
777 // Did we find the non-last chunk? Then our position must be within chunk_no.
782 // checking whether the # bytes in a chunk are equal to the # chars, and if
800 // Since position was within the chunk, SkipToPosition should have found
806 // What's left: We're in the last, non-terminating chunk. Our position
807 // may be in the chunk, but it may also be in 'future' chunks, which we'll
820 // of data. In that case, we'll point to the terminating chunk.
840 // can't guarantee progress with one chunk. Thus we iterate.)