diff src/vim9.h @ 20257:683c2da4982b v8.2.0684

patch 8.2.0684: Vim9: memory leak when using lambda Commit: https://github.com/vim/vim/commit/f7779c63d4fe531e2483502d4441f24802342768 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 3 15:38:16 2020 +0200 patch 8.2.0684: Vim9: memory leak when using lambda Problem: Vim9: memory leak when using lambda. Solution: Move the funccal context to the partial. Free the function when exiting.
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 May 2020 15:45:05 +0200
parents e46e72aaff74
children bc2c9ea94ec1
line wrap: on
line diff
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -260,21 +260,6 @@ struct isn_S {
 };
 
 /*
- * Structure to hold the context of a compiled function, used by closures
- * defined in that function.
- */
-typedef struct funcstack_S
-{
-    garray_T	fs_ga;		// contains the stack, with:
-				// - arguments
-				// - frame
-				// - local variables
-
-    int		fs_refcount;	// nr of closures referencing this funcstack
-    int		fs_copyID;	// for garray_T collection
-} funcstack_T;
-
-/*
  * Info about a function defined with :def.  Used in "def_functions".
  */
 struct dfunc_S {
@@ -286,11 +271,6 @@ struct dfunc_S {
     isn_T	*df_instr;	    // function body to be executed
     int		df_instr_count;
 
-    garray_T	*df_ectx_stack;	    // where compiled closure finds local vars
-    int		df_ectx_frame;	    // index of function frame in uf_ectx_stack
-    funcstack_T	*df_funcstack;	    // copy of stack for closure, used after
-				    // closure context function returns
-
     int		df_varcount;	    // number of local variables
     int		df_closure_count;   // number of closures created
 };