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

Method enqueueLocked

bolt/exec/ExchangeQueue.cpp:85–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void ExchangeQueue::enqueueLocked(
86 std::unique_ptr<SerializedPage>&& page,
87 std::vector<ContinuePromise>& promises) {
88 if (page == nullptr) {
89 ++numCompleted_;
90 auto completedPromises = checkCompleteLocked();
91 promises.reserve(promises.size() + completedPromises.size());
92 for (auto& promise : completedPromises) {
93 promises.push_back(std::move(promise));
94 }
95 return;
96 }
97
98 totalBytes_ += page->size();
99 if (peakBytes_ < totalBytes_) {
100 peakBytes_ = totalBytes_;
101 }
102
103 ++receivedPages_;
104 receivedBytes_ += page->size();
105
106 queue_.push_back(std::move(page));
107 if (!promises_.empty()) {
108 // Resume one of the waiting drivers.
109 promises.push_back(std::move(promises_.back()));
110 promises_.pop_back();
111 }
112}
113
114std::vector<std::unique_ptr<SerializedPage>> ExchangeQueue::dequeueLocked(
115 uint32_t maxBytes,

Callers 2

enqueueMethod · 0.80
requestMethod · 0.80

Calls 6

backMethod · 0.80
pop_backMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by 2

enqueueMethod · 0.64
requestMethod · 0.64