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