Skip to content

Commit

Permalink
wstream: Use a default value of 10mb for maxmem when 0 is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
tarruda committed Jun 24, 2014
1 parent 11916b6 commit 30fc6a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/nvim/os/wstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,6 +45,10 @@ typedef struct {
/// @return The newly-allocated `WStream` instance
WStream * wstream_new(size_t maxmem)
{
if (!maxmem) {

This comment has been minimized.

Copy link
@oni-link

oni-link Jun 25, 2014

Can this behaviour be documented in the function description?

This comment has been minimized.

Copy link
@tarruda

tarruda Jun 26, 2014

Author Owner

👍

maxmem = DEFAULT_MAXMEM;
}

WStream *rv = xmalloc(sizeof(WStream));
rv->maxmem = maxmem;
rv->stream = NULL;
Expand Down

0 comments on commit 30fc6a4

Please sign in to comment.