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

Method HeapPush

adapter/micro_thread/heap.h:239–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238
239inline int HeapList::HeapPush(HeapEntry* item)
240{
241 if (HeapFull()) {
242 heap_assert(0); // it's possible in theory but not in fact.
243 return -1;
244 }
245
246 if (item->GetIndex() != 0) {
247 heap_assert(0); // duplicated insertion.
248 return -2;
249 }
250
251 _count++;
252 _list[_count] = item;
253 item->SetIndex(_count);
254
255 HeapUp();
256
257 return 0;
258}
259
260
261inline HeapEntry* HeapList::HeapPop()

Callers 3

start_timerMethod · 0.80
InsertSleepMethod · 0.80
InsertIntoHeapMethod · 0.80

Calls 2

GetIndexMethod · 0.80
SetIndexMethod · 0.80

Tested by

no test coverage detected