MCPcopy Create free account
hub / github.com/F-Stack/f-stack / HeapPop

Method HeapPop

adapter/micro_thread/heap.h:261–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259
260
261inline HeapEntry* HeapList::HeapPop()
262{
263 if (HeapEmpty()) {
264 return NULL;
265 }
266
267 HeapEntry* top = _list[1]; // 0 reserved.
268
269 _list[1] = _list[_count];
270 _list[1]->SetIndex(1);
271 _list[_count] = 0;
272
273 _count--;
274 HeapDown(1);
275
276 heap_assert(top->GetIndex() == 1);
277 top->SetIndex(0);
278 return top;
279}
280
281inline int HeapList::HeapDelete(HeapEntry* item)
282{

Callers 1

DestroyMethod · 0.80

Calls 2

SetIndexMethod · 0.80
GetIndexMethod · 0.80

Tested by

no test coverage detected