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