From 521e45f2a8c0619335288accdda0f0aaa1fc6513 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Mon, 24 Oct 2016 23:53:07 -0700 Subject: vim-patch:7.4.1559 Problem: Passing cookie to a callback is clumsy. Solution: Change function() to take arguments and return a partial. https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710 --- src/nvim/api/private/helpers.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/api/private/helpers.c') diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 72db7c0782..0acdff3232 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -360,6 +360,9 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) #define TYPVAL_ENCODE_CONV_FUNC(fun) \ TYPVAL_ENCODE_CONV_NIL() +#define TYPVAL_ENCODE_CONV_PARTIAL(partial) \ + TYPVAL_ENCODE_CONV_NIL() + #define TYPVAL_ENCODE_CONV_EMPTY_LIST() \ kv_push(edata->stack, ARRAY_OBJ(((Array) { .capacity = 0, .size = 0 }))) @@ -482,6 +485,7 @@ TYPVAL_ENCODE_DEFINE_CONV_FUNCTIONS(static, object, EncodedData *const, edata) #undef TYPVAL_ENCODE_CONV_NUMBER #undef TYPVAL_ENCODE_CONV_FLOAT #undef TYPVAL_ENCODE_CONV_FUNC +#undef TYPVAL_ENCODE_CONV_PARTIAL #undef TYPVAL_ENCODE_CONV_EMPTY_LIST #undef TYPVAL_ENCODE_CONV_LIST_START #undef TYPVAL_ENCODE_CONV_EMPTY_DICT -- cgit From 25438f149fda66375ed54a735e4477f3f4d87338 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Sun, 30 Oct 2016 15:10:11 -0700 Subject: vim-patch:7.4.1719 Problem: Leaking memory when there is a cycle involving a job and a partial. Solution: Add a copyID to job and channel. Set references in items referred by them. Go through all jobs and channels to find unreferenced items. Also, decrement reference counts when garbage collecting. https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5 --- src/nvim/api/private/helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/api/private/helpers.c') diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 0acdff3232..b004cfc7a1 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -657,7 +657,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) if (!object_to_vim(item, &li->li_tv, err)) { // cleanup listitem_free(li); - list_free(list, true); + list_free(list); return false; } @@ -681,7 +681,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) api_set_error(err, Validation, _("Empty dictionary keys aren't allowed")); // cleanup - dict_free(dict, true); + dict_free(dict); return false; } @@ -690,7 +690,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) if (!object_to_vim(item.value, &di->di_tv, err)) { // cleanup dictitem_free(di); - dict_free(dict, true); + dict_free(dict); return false; } -- cgit