MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sdsclear

Function sdsclear

app/redis-6.2.6/src/sds.c:222–225  ·  view source on GitHub ↗

Modify an sds string in-place to make it empty (zero length). * However all the existing buffer is not discarded but set as free space * so that next append operations will not require allocations up to the * number of bytes previously available. */

Source from the content-addressed store, hash-verified

220 * so that next append operations will not require allocations up to the
221 * number of bytes previously available. */
222void sdsclear(sds s) {
223 sdssetlen(s, 0);
224 s[0] = '\0';
225}
226
227/* Enlarge the free space at the end of the sds string so that the caller
228 * is sure that after calling this function can overwrite up to addlen

Callers 7

replicationCacheMasterFunction · 0.85
processMultibulkBufferFunction · 0.85
getAllClientsInfoStringFunction · 0.85
rioInitWithConnFunction · 0.85
rioFdWriteFunction · 0.85
cliWriteConnFunction · 0.85
flushAppendOnlyFileFunction · 0.85

Calls 1

sdssetlenFunction · 0.85

Tested by

no test coverage detected