Revert "Don't zero out potentially long buffers" - It has no benefit above the noise floor and potentially is the cause of a multithread slowdown

This reverts commit 9a9841afb3ffac4ebece0ec911b35ce1fe1c7e35 [formerly 91e76ab4a00546278100baf6dfe61c13e802b40e].


Former-commit-id: f651cf67d731a10c3a52e30261c8d8b9d291576c
This commit is contained in:
John Sully 2021-09-28 18:08:15 +00:00
parent 8210d67c24
commit 663f0bca3e
2 changed files with 1 additions and 3 deletions

View File

@ -102,11 +102,10 @@ robj *createEmbeddedStringObject(const char *ptr, size_t len) {
allocsize = sizeof(void*);
size_t mvccExtraBytes = g_pserver->fActiveReplica ? sizeof(redisObjectExtended) : 0;
char *oB = (char*)zmalloc(sizeof(robj)+allocsize-sizeof(redisObject::m_ptr)+mvccExtraBytes, MALLOC_SHARED);
char *oB = (char*)zcalloc(sizeof(robj)+allocsize-sizeof(redisObject::m_ptr)+mvccExtraBytes, MALLOC_SHARED);
robj *o = reinterpret_cast<robj*>(oB + mvccExtraBytes);
struct sdshdr8 *sh = (sdshdr8*)(&o->m_ptr);
new (o) redisObject;
o->type = OBJ_STRING;
o->encoding = OBJ_ENCODING_EMBSTR;
o->setrefcount(1);

View File

@ -950,7 +950,6 @@ struct redisObjectExtended {
};
typedef struct redisObject {
friend redisObject *createEmbeddedStringObject(const char *ptr, size_t len);
protected:
redisObject() {}