summaryrefslogtreecommitdiff
path: root/data/vim/patches/7.2.005
blob: 20cce85b36423a4e43f9f4c0112dfb1dda68aaab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
To: vim-dev@vim.org
Subject: Patch 7.2.005
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.005
Problem:    A few problems when profiling.  Using flag pointer instead of flag
            value.  Allocating zero bytes.  Not freeing used memory.
Solution:   Remove wrong '&' characters.  Skip dumping when there is nothing
            to dump.  Free used memory. (Dominique Pelle)
Files:      src/eval.c


*** ../vim-7.2.004/src/eval.c	Fri Aug  8 12:36:31 2008
--- src/eval.c	Mon Aug 25 04:40:11 2008
***************
*** 3657,3664 ****
  }
  
  /*
!  * Return TRUE if typeval "tv" is locked: Either tha value is locked itself or
!  * it refers to a List or Dictionary that is locked.
   */
      static int
  tv_islocked(tv)
--- 3657,3664 ----
  }
  
  /*
!  * Return TRUE if typeval "tv" is locked: Either that value is locked itself
!  * or it refers to a List or Dictionary that is locked.
   */
      static int
  tv_islocked(tv)
***************
*** 15838,15847 ****
      if (res == FAIL)
  	res = ITEM_COMPARE_FAIL;
      else
- 	/* return value has wrong type */
  	res = get_tv_number_chk(&rettv, &item_compare_func_err);
      if (item_compare_func_err)
! 	res = ITEM_COMPARE_FAIL;
      clear_tv(&rettv);
      return res;
  }
--- 15838,15846 ----
      if (res == FAIL)
  	res = ITEM_COMPARE_FAIL;
      else
  	res = get_tv_number_chk(&rettv, &item_compare_func_err);
      if (item_compare_func_err)
! 	res = ITEM_COMPARE_FAIL;  /* return value has wrong type */
      clear_tv(&rettv);
      return res;
  }
***************
*** 20590,20595 ****
--- 20589,20597 ----
      int		st_len = 0;
  
      todo = (int)func_hashtab.ht_used;
+     if (todo == 0)
+ 	return;     /* nothing to dump */
+ 
      sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo));
  
      for (hi = func_hashtab.ht_array; todo > 0; ++hi)
***************
*** 20638,20643 ****
--- 20640,20647 ----
  							      prof_self_cmp);
  	prof_sort_list(fd, sorttab, st_len, "SELF", TRUE);
      }
+ 
+     vim_free(sorttab);
  }
  
      static void
***************
*** 21204,21210 ****
  	if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
  	    func_do_profile(fp);
  	if (fp->uf_profiling
! 		       || (fc.caller != NULL && &fc.caller->func->uf_profiling))
  	{
  	    ++fp->uf_tm_count;
  	    profile_start(&call_start);
--- 21208,21214 ----
  	if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
  	    func_do_profile(fp);
  	if (fp->uf_profiling
! 		       || (fc.caller != NULL && fc.caller->func->uf_profiling))
  	{
  	    ++fp->uf_tm_count;
  	    profile_start(&call_start);
***************
*** 21235,21247 ****
  
  #ifdef FEAT_PROFILE
      if (do_profiling == PROF_YES && (fp->uf_profiling
! 		    || (fc.caller != NULL && &fc.caller->func->uf_profiling)))
      {
  	profile_end(&call_start);
  	profile_sub_wait(&wait_start, &call_start);
  	profile_add(&fp->uf_tm_total, &call_start);
  	profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
! 	if (fc.caller != NULL && &fc.caller->func->uf_profiling)
  	{
  	    profile_add(&fc.caller->func->uf_tm_children, &call_start);
  	    profile_add(&fc.caller->func->uf_tml_children, &call_start);
--- 21239,21251 ----
  
  #ifdef FEAT_PROFILE
      if (do_profiling == PROF_YES && (fp->uf_profiling
! 		    || (fc.caller != NULL && fc.caller->func->uf_profiling)))
      {
  	profile_end(&call_start);
  	profile_sub_wait(&wait_start, &call_start);
  	profile_add(&fp->uf_tm_total, &call_start);
  	profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
! 	if (fc.caller != NULL && fc.caller->func->uf_profiling)
  	{
  	    profile_add(&fc.caller->func->uf_tm_children, &call_start);
  	    profile_add(&fc.caller->func->uf_tml_children, &call_start);
*** ../vim-7.2.004/src/version.c	Mon Aug 25 04:35:13 2008
--- src/version.c	Mon Aug 25 04:46:44 2008
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     5,
  /**/

-- 
The process for understanding customers primarily involves sitting around with
other marketing people and talking about what you would to if you were dumb
enough to be a customer.
				(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///