d12698c
To: vim-dev@vim.org
d12698c
Subject: Patch 7.2.005
d12698c
Fcc: outbox
d12698c
From: Bram Moolenaar <Bram@moolenaar.net>
d12698c
Mime-Version: 1.0
d12698c
Content-Type: text/plain; charset=ISO-8859-1
d12698c
Content-Transfer-Encoding: 8bit
d12698c
------------
d12698c
d12698c
Patch 7.2.005
d12698c
Problem:    A few problems when profiling.  Using flag pointer instead of flag
d12698c
            value.  Allocating zero bytes.  Not freeing used memory.
d12698c
Solution:   Remove wrong '&' characters.  Skip dumping when there is nothing
d12698c
            to dump.  Free used memory. (Dominique Pelle)
d12698c
Files:      src/eval.c
d12698c
d12698c
d12698c
*** ../vim-7.2.004/src/eval.c	Fri Aug  8 12:36:31 2008
d12698c
--- src/eval.c	Mon Aug 25 04:40:11 2008
d12698c
***************
d12698c
*** 3657,3664 ****
d12698c
  }
d12698c
  
d12698c
  /*
d12698c
!  * Return TRUE if typeval "tv" is locked: Either tha value is locked itself or
d12698c
!  * it refers to a List or Dictionary that is locked.
d12698c
   */
d12698c
      static int
d12698c
  tv_islocked(tv)
d12698c
--- 3657,3664 ----
d12698c
  }
d12698c
  
d12698c
  /*
d12698c
!  * Return TRUE if typeval "tv" is locked: Either that value is locked itself
d12698c
!  * or it refers to a List or Dictionary that is locked.
d12698c
   */
d12698c
      static int
d12698c
  tv_islocked(tv)
d12698c
***************
d12698c
*** 15838,15847 ****
d12698c
      if (res == FAIL)
d12698c
  	res = ITEM_COMPARE_FAIL;
d12698c
      else
d12698c
- 	/* return value has wrong type */
d12698c
  	res = get_tv_number_chk(&rettv, &item_compare_func_err);
d12698c
      if (item_compare_func_err)
d12698c
! 	res = ITEM_COMPARE_FAIL;
d12698c
      clear_tv(&rettv);
d12698c
      return res;
d12698c
  }
d12698c
--- 15838,15846 ----
d12698c
      if (res == FAIL)
d12698c
  	res = ITEM_COMPARE_FAIL;
d12698c
      else
d12698c
  	res = get_tv_number_chk(&rettv, &item_compare_func_err);
d12698c
      if (item_compare_func_err)
d12698c
! 	res = ITEM_COMPARE_FAIL;  /* return value has wrong type */
d12698c
      clear_tv(&rettv);
d12698c
      return res;
d12698c
  }
d12698c
***************
d12698c
*** 20590,20595 ****
d12698c
--- 20589,20597 ----
d12698c
      int		st_len = 0;
d12698c
  
d12698c
      todo = (int)func_hashtab.ht_used;
d12698c
+     if (todo == 0)
d12698c
+ 	return;     /* nothing to dump */
d12698c
+ 
d12698c
      sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo));
d12698c
  
d12698c
      for (hi = func_hashtab.ht_array; todo > 0; ++hi)
d12698c
***************
d12698c
*** 20638,20643 ****
d12698c
--- 20640,20647 ----
d12698c
  							      prof_self_cmp);
d12698c
  	prof_sort_list(fd, sorttab, st_len, "SELF", TRUE);
d12698c
      }
d12698c
+ 
d12698c
+     vim_free(sorttab);
d12698c
  }
d12698c
  
d12698c
      static void
d12698c
***************
d12698c
*** 21204,21210 ****
d12698c
  	if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
d12698c
  	    func_do_profile(fp);
d12698c
  	if (fp->uf_profiling
d12698c
! 		       || (fc.caller != NULL && &fc.caller->func->uf_profiling))
d12698c
  	{
d12698c
  	    ++fp->uf_tm_count;
d12698c
  	    profile_start(&call_start);
d12698c
--- 21208,21214 ----
d12698c
  	if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
d12698c
  	    func_do_profile(fp);
d12698c
  	if (fp->uf_profiling
d12698c
! 		       || (fc.caller != NULL && fc.caller->func->uf_profiling))
d12698c
  	{
d12698c
  	    ++fp->uf_tm_count;
d12698c
  	    profile_start(&call_start);
d12698c
***************
d12698c
*** 21235,21247 ****
d12698c
  
d12698c
  #ifdef FEAT_PROFILE
d12698c
      if (do_profiling == PROF_YES && (fp->uf_profiling
d12698c
! 		    || (fc.caller != NULL && &fc.caller->func->uf_profiling)))
d12698c
      {
d12698c
  	profile_end(&call_start);
d12698c
  	profile_sub_wait(&wait_start, &call_start);
d12698c
  	profile_add(&fp->uf_tm_total, &call_start);
d12698c
  	profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
d12698c
! 	if (fc.caller != NULL && &fc.caller->func->uf_profiling)
d12698c
  	{
d12698c
  	    profile_add(&fc.caller->func->uf_tm_children, &call_start);
d12698c
  	    profile_add(&fc.caller->func->uf_tml_children, &call_start);
d12698c
--- 21239,21251 ----
d12698c
  
d12698c
  #ifdef FEAT_PROFILE
d12698c
      if (do_profiling == PROF_YES && (fp->uf_profiling
d12698c
! 		    || (fc.caller != NULL && fc.caller->func->uf_profiling)))
d12698c
      {
d12698c
  	profile_end(&call_start);
d12698c
  	profile_sub_wait(&wait_start, &call_start);
d12698c
  	profile_add(&fp->uf_tm_total, &call_start);
d12698c
  	profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
d12698c
! 	if (fc.caller != NULL && fc.caller->func->uf_profiling)
d12698c
  	{
d12698c
  	    profile_add(&fc.caller->func->uf_tm_children, &call_start);
d12698c
  	    profile_add(&fc.caller->func->uf_tml_children, &call_start);
d12698c
*** ../vim-7.2.004/src/version.c	Mon Aug 25 04:35:13 2008
d12698c
--- src/version.c	Mon Aug 25 04:46:44 2008
d12698c
***************
d12698c
*** 678,679 ****
d12698c
--- 678,681 ----
d12698c
  {   /* Add new patch number below this line */
d12698c
+ /**/
d12698c
+     5,
d12698c
  /**/
d12698c
d12698c
-- 
d12698c
The process for understanding customers primarily involves sitting around with
d12698c
other marketing people and talking about what you would to if you were dumb
d12698c
enough to be a customer.
d12698c
				(Scott Adams - The Dilbert principle)
d12698c
d12698c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
d12698c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
d12698c
\\\        download, build and distribute -- http://www.A-A-P.org        ///
d12698c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///