mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
REDIS_ENCODING_EMBSTR_SIZE_LIMIT set to 39.
The new value is the limit for the robj + SDS header + string + null-term to stay inside the 64 bytes Jemalloc arena in 64 bits systems.
This commit is contained in:
parent
76c31d425e
commit
0b0f872f3f
@ -76,8 +76,11 @@ robj *createEmbeddedStringObject(char *ptr, size_t len) {
|
||||
|
||||
/* Create a string object with EMBSTR encoding if it is smaller than
|
||||
* REIDS_ENCODING_EMBSTR_SIZE_LIMIT, otherwise the RAW encoding is
|
||||
* used. */
|
||||
#define REDIS_ENCODING_EMBSTR_SIZE_LIMIT 32
|
||||
* used.
|
||||
*
|
||||
* The current limit of 39 is chosen so that the biggest string object
|
||||
* we allocate as EMBSTR will still fit into the 64 byte arena of jemalloc. */
|
||||
#define REDIS_ENCODING_EMBSTR_SIZE_LIMIT 39
|
||||
robj *createStringObject(char *ptr, size_t len) {
|
||||
if (len <= REDIS_ENCODING_EMBSTR_SIZE_LIMIT)
|
||||
return createEmbeddedStringObject(ptr,len);
|
||||
|
Loading…
Reference in New Issue
Block a user