mirror of
https://github.com/fluencelabs/redis
synced 2025-06-14 09:41:21 +00:00
Re-use AOF buffer when it is small enough
This commit is contained in:
committed by
antirez
parent
a57225c2cf
commit
f990782f4d
@ -94,6 +94,13 @@ void sdsupdatelen(sds s) {
|
||||
sh->len = reallen;
|
||||
}
|
||||
|
||||
void sdsclear(sds s) {
|
||||
struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));
|
||||
sh->free += sh->len;
|
||||
sh->len = 0;
|
||||
sh->buf[0] = '\0';
|
||||
}
|
||||
|
||||
static sds sdsMakeRoomFor(sds s, size_t addlen) {
|
||||
struct sdshdr *sh, *newsh;
|
||||
size_t free = sdsavail(s);
|
||||
|
Reference in New Issue
Block a user