MCPcopy Create free account
hub / github.com/bytedance/bolt / enqueueArbitraryOutputLocked

Method enqueueArbitraryOutputLocked

bolt/exec/OutputBuffer.cpp:496–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496void OutputBuffer::enqueueArbitraryOutputLocked(
497 std::unique_ptr<SerializedPage> data,
498 std::vector<DataAvailable>& dataAvailableCbs) {
499 BOLT_DCHECK(isArbitrary());
500 BOLT_DCHECK_NOT_NULL(arbitraryBuffer_);
501 BOLT_DCHECK(dataAvailableCbs.empty());
502 BOLT_CHECK(!arbitraryBuffer_->hasNoMoreData());
503
504 arbitraryBuffer_->enqueue(std::move(data));
505 BOLT_CHECK_LT(nextArbitraryLoadBufferIndex_, buffers_.size());
506 int32_t bufferId = nextArbitraryLoadBufferIndex_;
507 for (int32_t i = 0; i < buffers_.size();
508 ++i, bufferId = (bufferId + 1) % buffers_.size()) {
509 if (arbitraryBuffer_->empty()) {
510 nextArbitraryLoadBufferIndex_ = bufferId;
511 break;
512 }
513 auto* buffer = buffers_[bufferId].get();
514 if (buffer == nullptr) {
515 continue;
516 }
517 buffer->maybeLoadData(arbitraryBuffer_.get());
518 dataAvailableCbs.emplace_back(buffer->getAndClearNotify());
519 }
520}
521
522void OutputBuffer::enqueuePartitionedOutputLocked(
523 int destination,

Callers

nothing calls this directly

Calls 7

hasNoMoreDataMethod · 0.80
maybeLoadDataMethod · 0.80
getAndClearNotifyMethod · 0.80
emptyMethod · 0.45
enqueueMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected