Make aof buf alloc size more accurate in overhead (#8970)

In theory we should have used zmalloc_usable_size, but it may be slower,
and now after #7875, there's no actual difference.
So this change isn't making a dramatic change.

Co-authored-by: Oran Agra <oran@redislabs.com>
This commit is contained in:
Wang Yuan 2021-05-20 20:04:17 +08:00 committed by GitHub
parent 0b2d0be35a
commit 8627751ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,7 +342,7 @@ size_t freeMemoryGetNotCountedMemory(void) {
}
}
if (server.aof_state != AOF_OFF) {
overhead += sdsalloc(server.aof_buf)+aofRewriteBufferSize();
overhead += sdsAllocSize(server.aof_buf)+aofRewriteBufferSize();
}
return overhead;
}