MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / raxFindParentLink

Function raxFindParentLink

src/rax.c:934–943  ·  view source on GitHub ↗

Return the memory address where the 'parent' node stores the specified * 'child' pointer, so that the caller can update the pointer with another * one if needed. The function assumes it will find a match, otherwise the * operation is an undefined behavior (it will continue scanning the * memory without any bound checking). */

Source from the content-addressed store, hash-verified

932 * operation is an undefined behavior (it will continue scanning the
933 * memory without any bound checking). */
934raxNode **raxFindParentLink(raxNode *parent, raxNode *child) {
935 raxNode **cp = raxNodeFirstChildPtr(parent);
936 raxNode *c;
937 while(1) {
938 memcpy(&c,cp,sizeof(c));
939 if (c == child) break;
940 cp++;
941 }
942 return cp;
943}
944
945/* Low level child removal from node. The new node pointer (after the child
946 * removal) is returned. Note that this function does not fix the pointer

Callers 1

raxRemoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected