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

Function DataBlock_GetItem

src/util/datablock/datablock.c:154–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void *DataBlock_GetItem(const DataBlock *dataBlock, uint64_t idx) {
155 ASSERT(dataBlock != NULL);
156
157 // return NULL if idx is out of bounds
158 if(_DataBlock_IndexOutOfBounds(dataBlock, idx)) return NULL;
159
160 DataBlockItemHeader *item_header = DataBlock_GetItemHeader(dataBlock, idx);
161
162 // Incase item is marked as deleted, return NULL.
163 if(IS_ITEM_DELETED(item_header)) return NULL;
164
165 return ITEM_DATA(item_header);
166}
167
168uint64_t DataBlock_GetReservedIdx(const DataBlock *dataBlock, uint64_t n) {
169 ASSERT(dataBlock != NULL);

Callers 6

ResultSet_ReplyFunction · 0.85
ResultSet_FreeFunction · 0.85
_CollectEdgesFromEntryFunction · 0.85
_Graph_GetEntityFunction · 0.85
test_dataBlockAddItemFunction · 0.85
test_dataBlockRemoveItemFunction · 0.85

Calls 2

DataBlock_GetItemHeaderFunction · 0.85

Tested by 2

test_dataBlockAddItemFunction · 0.68
test_dataBlockRemoveItemFunction · 0.68