aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval_defs.h
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-12-16 15:07:03 -0700
committerMichael Ennen <mike.ennen@gmail.com>2017-02-14 17:38:18 -0700
commit00ac82eae276e358f54f5db657f2440701da7810 (patch)
tree8c2509df54314f9a8bb5b3a15a193d198c581671 /src/nvim/eval_defs.h
parent42727ecf086b444ed6dd91798a0106a835536792 (diff)
downloadrneovim-00ac82eae276e358f54f5db657f2440701da7810.tar.gz
rneovim-00ac82eae276e358f54f5db657f2440701da7810.tar.bz2
rneovim-00ac82eae276e358f54f5db657f2440701da7810.zip
vim-patch:7.4.2142
Problem: Leaking memory when redefining a function. Solution: Don't increment the function reference count when it's found by name. Don't remove the wrong function from the hashtab. More reference counting fixes. https://github.com/vim/vim/commit/8dd3a43d75550e9b5736066124c97697564f769e
Diffstat (limited to 'src/nvim/eval_defs.h')
-rw-r--r--src/nvim/eval_defs.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/eval_defs.h b/src/nvim/eval_defs.h
index a81348d124..ffaeb14e22 100644
--- a/src/nvim/eval_defs.h
+++ b/src/nvim/eval_defs.h
@@ -184,7 +184,7 @@ struct ufunc {
int uf_tml_execed; ///< line being timed was executed
scid_T uf_script_ID; ///< ID of script where function was defined,
// used for s: variables
- int uf_refcount; ///< for numbered function: reference count
+ int uf_refcount; ///< reference count, see func_name_refcount()
funccall_T *uf_scoped; ///< l: local variables for closure
char_u uf_name[1]; ///< name of function (actually longer); can
// start with <SNR>123_ (<SNR> is K_SPECIAL
@@ -218,9 +218,11 @@ struct funccall_S {
int level; // top nesting level of executed function
proftime_T prof_child; // time spent in a child
funccall_T *caller; // calling function or NULL
- int fc_refcount;
+ int fc_refcount; // number of user functions that reference
+ // this funccal
int fc_copyID; // for garbage collection
- garray_T fc_funcs; // list of ufunc_T* which refer this
+ garray_T fc_funcs; // list of ufunc_T* which keep a reference
+ // to "func"
};
// structure used by trans_function_name()