Karsten Hopp 508553
To: vim-dev@vim.org
Karsten Hopp 508553
Subject: Patch 7.0.092
Karsten Hopp 508553
Fcc: outbox
Karsten Hopp 508553
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 508553
Mime-Version: 1.0
Karsten Hopp 508553
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 508553
Content-Transfer-Encoding: 8bit
Karsten Hopp 508553
------------
Karsten Hopp 508553
Karsten Hopp 508553
Patch 7.0.092 (after 7.0.082 and 7.0.084)
Karsten Hopp 508553
Problem:    The list of internal function arguments is obsolete now that
Karsten Hopp 508553
	    garbage collection is only done at the toplevel.
Karsten Hopp 508553
Solution:   Remove the list of all arguments to internal functions.
Karsten Hopp 508553
Files:	    src/eval.c
Karsten Hopp 508553
Karsten Hopp 508553
Karsten Hopp 508553
*** ../vim-7.0.091/src/eval.c	Wed Sep  6 22:14:42 2006
Karsten Hopp 508553
--- src/eval.c	Sat Sep  9 12:00:28 2006
Karsten Hopp 508553
***************
Karsten Hopp 508553
*** 248,264 ****
Karsten Hopp 508553
  };
Karsten Hopp 508553
  
Karsten Hopp 508553
  /*
Karsten Hopp 508553
-  * Struct used to make a list of all arguments used in internal functions.
Karsten Hopp 508553
-  */
Karsten Hopp 508553
- typedef struct av_list_item_S av_list_item_T;
Karsten Hopp 508553
- struct av_list_item_S {
Karsten Hopp 508553
-     av_list_item_T  *avl_next;
Karsten Hopp 508553
-     typval_T	    *avl_argvars;
Karsten Hopp 508553
- };
Karsten Hopp 508553
- 
Karsten Hopp 508553
- av_list_item_T *argvars_list = NULL;
Karsten Hopp 508553
- 
Karsten Hopp 508553
- /*
Karsten Hopp 508553
   * Info used by a ":for" loop.
Karsten Hopp 508553
   */
Karsten Hopp 508553
  typedef struct
Karsten Hopp 508553
--- 248,253 ----
Karsten Hopp 508553
***************
Karsten Hopp 508553
*** 6069,6075 ****
Karsten Hopp 508553
      int		i;
Karsten Hopp 508553
      funccall_T	*fc;
Karsten Hopp 508553
      int		did_free = FALSE;
Karsten Hopp 508553
-     av_list_item_T *av;
Karsten Hopp 508553
  #ifdef FEAT_WINDOWS
Karsten Hopp 508553
      tabpage_T	*tp;
Karsten Hopp 508553
  #endif
Karsten Hopp 508553
--- 6058,6063 ----
Karsten Hopp 508553
***************
Karsten Hopp 508553
*** 6110,6120 ****
Karsten Hopp 508553
  	set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID);
Karsten Hopp 508553
      }
Karsten Hopp 508553
  
Karsten Hopp 508553
-     /* arguments for internal functions */
Karsten Hopp 508553
-     for (av = argvars_list; av != NULL; av = av->avl_next)
Karsten Hopp 508553
- 	for (i = 0; av->avl_argvars[i].v_type != VAR_UNKNOWN; ++i)
Karsten Hopp 508553
- 	    set_ref_in_item(&av->avl_argvars[i], copyID);
Karsten Hopp 508553
- 
Karsten Hopp 508553
      /*
Karsten Hopp 508553
       * 2. Go through the list of dicts and free items without the copyID.
Karsten Hopp 508553
       */
Karsten Hopp 508553
--- 6098,6103 ----
Karsten Hopp 508553
***************
Karsten Hopp 508553
*** 7558,7578 ****
Karsten Hopp 508553
  		    error = ERROR_TOOMANY;
Karsten Hopp 508553
  		else
Karsten Hopp 508553
  		{
Karsten Hopp 508553
- 		    av_list_item_T  av_list_item;
Karsten Hopp 508553
- 
Karsten Hopp 508553
- 		    /* Add the arguments to the "argvars_list" to avoid the
Karsten Hopp 508553
- 		     * garbage collector not seeing them.  This isn't needed
Karsten Hopp 508553
- 		     * for user functions, because the arguments are available
Karsten Hopp 508553
- 		     * in the a: hashtab. */
Karsten Hopp 508553
- 		    av_list_item.avl_argvars = argvars;
Karsten Hopp 508553
- 		    av_list_item.avl_next = argvars_list;
Karsten Hopp 508553
- 		    argvars_list = &av_list_item;
Karsten Hopp 508553
- 
Karsten Hopp 508553
  		    argvars[argcount].v_type = VAR_UNKNOWN;
Karsten Hopp 508553
  		    functions[i].f_func(argvars, rettv);
Karsten Hopp 508553
  		    error = ERROR_NONE;
Karsten Hopp 508553
- 
Karsten Hopp 508553
- 		    argvars_list = av_list_item.avl_next;
Karsten Hopp 508553
  		}
Karsten Hopp 508553
  	    }
Karsten Hopp 508553
  	}
Karsten Hopp 508553
--- 7541,7549 ----
Karsten Hopp 508553
*** ../vim-7.0.091/src/version.c	Wed Sep  6 22:14:42 2006
Karsten Hopp 508553
--- src/version.c	Sat Sep  9 12:04:55 2006
Karsten Hopp 508553
***************
Karsten Hopp 508553
*** 668,669 ****
Karsten Hopp 508553
--- 668,671 ----
Karsten Hopp 508553
  {   /* Add new patch number below this line */
Karsten Hopp 508553
+ /**/
Karsten Hopp 508553
+     92,
Karsten Hopp 508553
  /**/
Karsten Hopp 508553
Karsten Hopp 508553
-- 
Karsten Hopp 508553
"Hegel was right when he said that we learn from history that man can
Karsten Hopp 508553
never learn anything from history."       (George Bernard Shaw)
Karsten Hopp 508553
Karsten Hopp 508553
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 508553
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 508553
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 508553
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///