mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
wstream: Use a default value of 10mb for maxmem
when 0 is passed
This commit is contained in:
parent
11916b6b59
commit
30fc6a4fd1
@ -9,6 +9,8 @@
|
||||
#include "nvim/vim.h"
|
||||
#include "nvim/memory.h"
|
||||
|
||||
#define DEFAULT_MAXMEM 1024 * 1024 * 10
|
||||
|
||||
struct wstream {
|
||||
uv_stream_t *stream;
|
||||
// Memory currently used by pending buffers
|
||||
@ -43,6 +45,10 @@ typedef struct {
|
||||
/// @return The newly-allocated `WStream` instance
|
||||
WStream * wstream_new(size_t maxmem)
|
||||
{
|
||||
if (!maxmem) {
|
||||
maxmem = DEFAULT_MAXMEM;
|
||||
}
|
||||
|
||||
WStream *rv = xmalloc(sizeof(WStream));
|
||||
rv->maxmem = maxmem;
|
||||
rv->stream = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user