mirror of
https://github.com/redis/redis.git
synced 2026-02-03 20:39:54 -05:00
Preallocate enough memory for the stream node if elements exceed stream_node_max_bytes
This commit is contained in:
parent
9d336ac398
commit
534b4f1cec
1 changed files with 1 additions and 0 deletions
|
|
@ -563,6 +563,7 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_
|
|||
if (server.stream_node_max_bytes > 0 && server.stream_node_max_bytes < prealloc) {
|
||||
prealloc = server.stream_node_max_bytes;
|
||||
}
|
||||
if (prealloc < totelelen) prealloc = totelelen;
|
||||
lp = lpNew(prealloc);
|
||||
lp = lpAppendInteger(lp,1); /* One item, the one we are adding. */
|
||||
lp = lpAppendInteger(lp,0); /* Zero deleted so far. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue