#include <pointer_block.h>
|
typedef Stack::Block | Block |
|
template<typename Stack>
class dart::BlockWorkList< Stack >
Definition at line 158 of file pointer_block.h.
◆ Block
template<typename Stack >
◆ BlockWorkList()
template<typename Stack >
Definition at line 162 of file pointer_block.h.
162 : stack_(stack) {
163 local_output_ = stack_->PopEmptyBlock();
164 local_input_ = stack_->PopEmptyBlock();
165 }
◆ ~BlockWorkList()
template<typename Stack >
◆ AbandonWork()
template<typename Stack >
Definition at line 260 of file pointer_block.h.
260 {
261 stack_->PushBlock(local_output_);
262 local_output_ = nullptr;
263 stack_->PushBlock(local_input_);
264 local_input_ = nullptr;
265 stack_ = nullptr;
266 }
◆ Finalize()
template<typename Stack >
Definition at line 249 of file pointer_block.h.
249 {
250 ASSERT(local_output_->IsEmpty());
251 stack_->PushBlock(local_output_);
252 local_output_ = nullptr;
253 ASSERT(local_input_->IsEmpty());
254 stack_->PushBlock(local_input_);
255 local_input_ = nullptr;
256
257 stack_ = nullptr;
258 }
◆ Flush()
template<typename Stack >
Definition at line 227 of file pointer_block.h.
227 {
228 if (!local_output_->IsEmpty()) {
229 stack_->PushBlock(local_output_);
230 local_output_ = stack_->PopEmptyBlock();
231 }
232 if (!local_input_->IsEmpty()) {
233 stack_->PushBlock(local_input_);
234 local_input_ = stack_->PopEmptyBlock();
235 }
236 }
◆ IsEmpty()
template<typename Stack >
◆ IsLocalEmpty()
template<typename Stack >
Definition at line 268 of file pointer_block.h.
268 {
269 if (!local_input_->IsEmpty()) {
270 return false;
271 }
272 if (!local_output_->IsEmpty()) {
273 return false;
274 }
275 return true;
276 }
◆ Pop() [1/2]
template<typename Stack >
Definition at line 199 of file pointer_block.h.
201 {
202 if (!first_choice->local_input_->IsEmpty()) {
203 *object = first_choice->local_input_->Pop();
204 return true;
205 }
206 if (!second_choice->local_input_->IsEmpty()) {
207 *object = second_choice->local_input_->Pop();
208 return true;
209 }
210 if (first_choice->Pop(object)) {
211 return true;
212 }
213 if (second_choice->Pop(object)) {
214 return true;
215 }
216 return false;
217 }
◆ Pop() [2/2]
template<typename Stack >
Definition at line 175 of file pointer_block.h.
175 {
176 ASSERT(local_input_ !=
nullptr);
177 if (
UNLIKELY(local_input_->IsEmpty())) {
178 if (!local_output_->IsEmpty()) {
179 auto temp = local_output_;
180 local_output_ = local_input_;
181 local_input_ = temp;
182 } else {
183 Block* new_work = stack_->PopNonEmptyBlock();
184 if (new_work == nullptr) {
185 return false;
186 }
187 stack_->PushBlock(local_input_);
188 local_input_ = new_work;
189
191 }
192 }
193 *object = local_input_->Pop();
194 return true;
195 }
#define MSAN_UNPOISON(ptr, len)
◆ Push()
template<typename Stack >
Definition at line 219 of file pointer_block.h.
219 {
220 if (
UNLIKELY(local_output_->IsFull())) {
221 stack_->PushBlock(local_output_);
222 local_output_ = stack_->PopEmptyBlock();
223 }
224 local_output_->Push(raw_obj);
225 }
◆ WaitForWork()
template<typename Stack >
Definition at line 238 of file pointer_block.h.
238 {
239 ASSERT(local_input_->IsEmpty() || abort);
240 Block* new_work = stack_->WaitForWork(num_busy, abort);
241 if (new_work == nullptr) {
242 return false;
243 }
244 stack_->PushBlock(local_input_);
245 local_input_ = new_work;
246 return true;
247 }
The documentation for this class was generated from the following file: