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

Function SI_ShareValue

src/value.c:124–129  ·  view source on GitHub ↗

Make an SIValue that reuses the original's allocations, if any. * The returned value is not responsible for freeing any allocations, * and is not guaranteed that these allocations will remain in scope. */

Source from the content-addressed store, hash-verified

122 * The returned value is not responsible for freeing any allocations,
123 * and is not guaranteed that these allocations will remain in scope. */
124SIValue SI_ShareValue(const SIValue v) {
125 SIValue dup = v;
126 // If the original value owns an allocation, mark that the duplicate shares it.
127 if(v.allocation == M_SELF) dup.allocation = M_VOLATILE;
128 return dup;
129}
130
131/* Make an SIValue that creates its own copies of the original's allocations, if any.
132 * This is not a deep clone: if the inner value holds its own references,

Callers 10

_AR_EXP_EvaluateVariadicFunction · 0.85
_AR_EXP_EvaluateParamFunction · 0.85
_AR_EXP_EvaluateFunction · 0.85
AR_REDUCEFunction · 0.85
AR_PROPERTYFunction · 0.85
_handoffFunction · 0.85
SIArray_GetFunction · 0.85
Map_GetFunction · 0.85
Map_GetIdxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected