diff options
| author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-20 10:37:06 -0300 | 
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-24 13:02:23 -0300 | 
| commit | 30fc6a4fd1b7b317e0f427fbbf981474524f55af (patch) | |
| tree | 03d314da91733986900ae2355f5ed21da4d2409d /src/nvim/os/wstream.c | |
| parent | 11916b6b595421ce2ece10f7aa40757cc4937c0c (diff) | |
| download | rneovim-30fc6a4fd1b7b317e0f427fbbf981474524f55af.tar.gz rneovim-30fc6a4fd1b7b317e0f427fbbf981474524f55af.tar.bz2 rneovim-30fc6a4fd1b7b317e0f427fbbf981474524f55af.zip | |
wstream: Use a default value of 10mb for `maxmem` when 0 is passed
Diffstat (limited to 'src/nvim/os/wstream.c')
| -rw-r--r-- | src/nvim/os/wstream.c | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/src/nvim/os/wstream.c b/src/nvim/os/wstream.c index a3037e477b..5c10401958 100644 --- a/src/nvim/os/wstream.c +++ b/src/nvim/os/wstream.c @@ -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; | 
