Don't zero out potentially long buffers
Former-commit-id: 99eb47e129a3cd555914d4816febb02f0058253a
This commit is contained in:
parent
ffcb77bc8d
commit
5eda1c5b42
@ -102,10 +102,11 @@ robj *createEmbeddedStringObject(const char *ptr, size_t len) {
|
||||
allocsize = sizeof(void*);
|
||||
|
||||
size_t mvccExtraBytes = g_pserver->fActiveReplica ? sizeof(redisObjectExtended) : 0;
|
||||
char *oB = (char*)zcalloc(sizeof(robj)+allocsize-sizeof(redisObject::m_ptr)+mvccExtraBytes, MALLOC_SHARED);
|
||||
char *oB = (char*)zmalloc(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);
|
||||
|
@ -951,6 +951,7 @@ struct redisObjectExtended {
|
||||
};
|
||||
|
||||
typedef struct redisObject {
|
||||
friend redisObject *createEmbeddedStringObject(const char *ptr, size_t len);
|
||||
protected:
|
||||
redisObject() {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user