Mercurial > vim
comparison src/proto/eval.pro @ 8863:e1b84109506a v7.4.1719
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 8 17:07:19 2016 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 08 Apr 2016 17:15:06 +0200 |
parents | 63dc856bd13d |
children | ed0b39dd7fd6 |
comparison
equal
deleted
inserted
replaced
8862:e759159b4432 | 8863:e1b84109506a |
---|---|
43 void ex_unlet(exarg_T *eap); | 43 void ex_unlet(exarg_T *eap); |
44 void ex_lockvar(exarg_T *eap); | 44 void ex_lockvar(exarg_T *eap); |
45 int do_unlet(char_u *name, int forceit); | 45 int do_unlet(char_u *name, int forceit); |
46 void del_menutrans_vars(void); | 46 void del_menutrans_vars(void); |
47 char_u *get_user_var_name(expand_T *xp, int idx); | 47 char_u *get_user_var_name(expand_T *xp, int idx); |
48 void partial_unref(partial_T *pt); | |
48 list_T *list_alloc(void); | 49 list_T *list_alloc(void); |
49 int rettv_list_alloc(typval_T *rettv); | 50 int rettv_list_alloc(typval_T *rettv); |
50 void list_unref(list_T *l); | 51 void list_unref(list_T *l); |
51 void list_free(list_T *l, int recurse); | 52 void list_free_internal(list_T *l); |
53 void list_free(list_T *l); | |
52 listitem_T *listitem_alloc(void); | 54 listitem_T *listitem_alloc(void); |
53 void listitem_free(listitem_T *item); | 55 void listitem_free(listitem_T *item); |
54 void listitem_remove(list_T *l, listitem_T *item); | 56 void listitem_remove(list_T *l, listitem_T *item); |
55 dictitem_T *dict_lookup(hashitem_T *hi); | 57 dictitem_T *dict_lookup(hashitem_T *hi); |
56 listitem_T *list_find(list_T *l, long n); | 58 listitem_T *list_find(list_T *l, long n); |
69 int set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack); | 71 int set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack); |
70 int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); | 72 int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); |
71 dict_T *dict_alloc(void); | 73 dict_T *dict_alloc(void); |
72 int rettv_dict_alloc(typval_T *rettv); | 74 int rettv_dict_alloc(typval_T *rettv); |
73 void dict_unref(dict_T *d); | 75 void dict_unref(dict_T *d); |
74 void dict_free(dict_T *d, int recurse); | 76 void dict_free_internal(dict_T *d); |
77 void dict_free(dict_T *d); | |
75 dictitem_T *dictitem_alloc(char_u *key); | 78 dictitem_T *dictitem_alloc(char_u *key); |
76 void dictitem_free(dictitem_T *item); | 79 void dictitem_free(dictitem_T *item); |
77 int dict_add(dict_T *d, dictitem_T *item); | 80 int dict_add(dict_T *d, dictitem_T *item); |
78 int dict_add_nr_str(dict_T *d, char *key, long nr, char_u *str); | 81 int dict_add_nr_str(dict_T *d, char *key, long nr, char_u *str); |
79 int dict_add_list(dict_T *d, char *key, list_T *list); | 82 int dict_add_list(dict_T *d, char *key, list_T *list); |
85 char_u *get_expr_name(expand_T *xp, int idx); | 88 char_u *get_expr_name(expand_T *xp, int idx); |
86 int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, partial_T *partial, dict_T *selfdict_in); | 89 int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, partial_T *partial, dict_T *selfdict_in); |
87 buf_T *buflist_find_by_name(char_u *name, int curtab_only); | 90 buf_T *buflist_find_by_name(char_u *name, int curtab_only); |
88 int func_call(char_u *name, typval_T *args, partial_T *partial, dict_T *selfdict, typval_T *rettv); | 91 int func_call(char_u *name, typval_T *args, partial_T *partial, dict_T *selfdict, typval_T *rettv); |
89 void dict_extend(dict_T *d1, dict_T *d2, char_u *action); | 92 void dict_extend(dict_T *d1, dict_T *d2, char_u *action); |
90 void partial_unref(partial_T *pt); | |
91 void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv); | 93 void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv); |
92 float_T vim_round(float_T f); | 94 float_T vim_round(float_T f); |
93 long do_searchpair(char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit); | 95 long do_searchpair(char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit); |
94 char_u *get_callback(typval_T *arg, partial_T **pp); | 96 char_u *get_callback(typval_T *arg, partial_T **pp); |
95 void set_vim_var_nr(int idx, long val); | 97 void set_vim_var_nr(int idx, long val); |