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

Function AttributeSet_AddPrepare

src/graph/entities/attribute_set.c:144–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144static AttributeSet AttributeSet_AddPrepare
145(
146 AttributeSet *set, // set to update
147 ushort n // number of attributes to add
148) {
149 ASSERT(set != NULL);
150
151 AttributeSet _set = *set;
152
153 // attribute-set can't be read-only
154 ASSERT(ATTRIBUTE_SET_IS_READONLY(_set) == false);
155
156 // allocate room for new attribute
157 if(_set == NULL) {
158 _set = rm_malloc(sizeof(_AttributeSet) + n * sizeof(Attribute));
159 _set->attr_count = n;
160 } else {
161 _set->attr_count += n;
162 _set = rm_realloc(_set, ATTRIBUTESET_BYTE_SIZE(_set));
163 }
164
165 return _set;
166}
167
168// adds an attribute to the set without cloning the SIvalue
169void AttributeSet_AddNoClone

Callers 3

AttributeSet_AddNoCloneFunction · 0.85
AttributeSet_AddFunction · 0.85

Calls 2

rm_mallocFunction · 0.85
rm_reallocFunction · 0.85

Tested by

no test coverage detected