]>
Commit | Line | Data |
---|---|---|
4c907a04 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.005 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.2.005 | |
11 | Problem: A few problems when profiling. Using flag pointer instead of flag | |
12 | value. Allocating zero bytes. Not freeing used memory. | |
13 | Solution: Remove wrong '&' characters. Skip dumping when there is nothing | |
14 | to dump. Free used memory. (Dominique Pelle) | |
15 | Files: src/eval.c | |
16 | ||
17 | ||
18 | *** ../vim-7.2.004/src/eval.c Fri Aug 8 12:36:31 2008 | |
19 | --- src/eval.c Mon Aug 25 04:40:11 2008 | |
20 | *************** | |
21 | *** 3657,3664 **** | |
22 | } | |
23 | ||
24 | /* | |
25 | ! * Return TRUE if typeval "tv" is locked: Either tha value is locked itself or | |
26 | ! * it refers to a List or Dictionary that is locked. | |
27 | */ | |
28 | static int | |
29 | tv_islocked(tv) | |
30 | --- 3657,3664 ---- | |
31 | } | |
32 | ||
33 | /* | |
34 | ! * Return TRUE if typeval "tv" is locked: Either that value is locked itself | |
35 | ! * or it refers to a List or Dictionary that is locked. | |
36 | */ | |
37 | static int | |
38 | tv_islocked(tv) | |
39 | *************** | |
40 | *** 15838,15847 **** | |
41 | if (res == FAIL) | |
42 | res = ITEM_COMPARE_FAIL; | |
43 | else | |
44 | - /* return value has wrong type */ | |
45 | res = get_tv_number_chk(&rettv, &item_compare_func_err); | |
46 | if (item_compare_func_err) | |
47 | ! res = ITEM_COMPARE_FAIL; | |
48 | clear_tv(&rettv); | |
49 | return res; | |
50 | } | |
51 | --- 15838,15846 ---- | |
52 | if (res == FAIL) | |
53 | res = ITEM_COMPARE_FAIL; | |
54 | else | |
55 | res = get_tv_number_chk(&rettv, &item_compare_func_err); | |
56 | if (item_compare_func_err) | |
57 | ! res = ITEM_COMPARE_FAIL; /* return value has wrong type */ | |
58 | clear_tv(&rettv); | |
59 | return res; | |
60 | } | |
61 | *************** | |
62 | *** 20590,20595 **** | |
63 | --- 20589,20597 ---- | |
64 | int st_len = 0; | |
65 | ||
66 | todo = (int)func_hashtab.ht_used; | |
67 | + if (todo == 0) | |
68 | + return; /* nothing to dump */ | |
69 | + | |
70 | sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo)); | |
71 | ||
72 | for (hi = func_hashtab.ht_array; todo > 0; ++hi) | |
73 | *************** | |
74 | *** 20638,20643 **** | |
75 | --- 20640,20647 ---- | |
76 | prof_self_cmp); | |
77 | prof_sort_list(fd, sorttab, st_len, "SELF", TRUE); | |
78 | } | |
79 | + | |
80 | + vim_free(sorttab); | |
81 | } | |
82 | ||
83 | static void | |
84 | *************** | |
85 | *** 21204,21210 **** | |
86 | if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) | |
87 | func_do_profile(fp); | |
88 | if (fp->uf_profiling | |
89 | ! || (fc.caller != NULL && &fc.caller->func->uf_profiling)) | |
90 | { | |
91 | ++fp->uf_tm_count; | |
92 | profile_start(&call_start); | |
93 | --- 21208,21214 ---- | |
94 | if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) | |
95 | func_do_profile(fp); | |
96 | if (fp->uf_profiling | |
97 | ! || (fc.caller != NULL && fc.caller->func->uf_profiling)) | |
98 | { | |
99 | ++fp->uf_tm_count; | |
100 | profile_start(&call_start); | |
101 | *************** | |
102 | *** 21235,21247 **** | |
103 | ||
104 | #ifdef FEAT_PROFILE | |
105 | if (do_profiling == PROF_YES && (fp->uf_profiling | |
106 | ! || (fc.caller != NULL && &fc.caller->func->uf_profiling))) | |
107 | { | |
108 | profile_end(&call_start); | |
109 | profile_sub_wait(&wait_start, &call_start); | |
110 | profile_add(&fp->uf_tm_total, &call_start); | |
111 | profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children); | |
112 | ! if (fc.caller != NULL && &fc.caller->func->uf_profiling) | |
113 | { | |
114 | profile_add(&fc.caller->func->uf_tm_children, &call_start); | |
115 | profile_add(&fc.caller->func->uf_tml_children, &call_start); | |
116 | --- 21239,21251 ---- | |
117 | ||
118 | #ifdef FEAT_PROFILE | |
119 | if (do_profiling == PROF_YES && (fp->uf_profiling | |
120 | ! || (fc.caller != NULL && fc.caller->func->uf_profiling))) | |
121 | { | |
122 | profile_end(&call_start); | |
123 | profile_sub_wait(&wait_start, &call_start); | |
124 | profile_add(&fp->uf_tm_total, &call_start); | |
125 | profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children); | |
126 | ! if (fc.caller != NULL && fc.caller->func->uf_profiling) | |
127 | { | |
128 | profile_add(&fc.caller->func->uf_tm_children, &call_start); | |
129 | profile_add(&fc.caller->func->uf_tml_children, &call_start); | |
130 | *** ../vim-7.2.004/src/version.c Mon Aug 25 04:35:13 2008 | |
131 | --- src/version.c Mon Aug 25 04:46:44 2008 | |
132 | *************** | |
133 | *** 678,679 **** | |
134 | --- 678,681 ---- | |
135 | { /* Add new patch number below this line */ | |
136 | + /**/ | |
137 | + 5, | |
138 | /**/ | |
139 | ||
140 | -- | |
141 | The process for understanding customers primarily involves sitting around with | |
142 | other marketing people and talking about what you would to if you were dumb | |
143 | enough to be a customer. | |
144 | (Scott Adams - The Dilbert principle) | |
145 | ||
146 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
147 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
148 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
149 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |