MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Heap_offer

Function Heap_offer

src/util/heap.c:196–207  ·  view source on GitHub ↗

add item, ensures that the data structure can hold the item NOTE: realloc() possibly called return 0 on success; -1 on failure

Source from the content-addressed store, hash-verified

194// NOTE: realloc() possibly called
195// return 0 on success; -1 on failure
196int Heap_offer
197(
198 heap_t **hp, // pointer to the heap, changed when heap is enlarged
199 void *item // item The item to be added
200) {
201 if(NULL == (*hp = __ensurecapacity(*hp))) {
202 return -1;
203 }
204
205 __Heap_offerx(*hp, item);
206 return 0;
207}
208
209// add item
210// an error will occur if there isn't enough space for this item

Callers 12

CRON_InsertTaskFunction · 0.85
SlowLog_AddFunction · 0.85
_accumulateFunction · 0.85
_add_pathFunction · 0.85
SPpaths_k_minimalFunction · 0.85
_add_pathFunction · 0.85
SSpaths_k_minimalFunction · 0.85
test_heapPopulateFunction · 0.85
test_heapPopulateDupFunction · 0.85
test_heapPopulateRandFunction · 0.85
test_heapRemoveElementFunction · 0.85
test_heapFuzzFunction · 0.85

Calls 2

__ensurecapacityFunction · 0.85
__Heap_offerxFunction · 0.85

Tested by 5

test_heapPopulateFunction · 0.68
test_heapPopulateDupFunction · 0.68
test_heapPopulateRandFunction · 0.68
test_heapRemoveElementFunction · 0.68
test_heapFuzzFunction · 0.68