patch 8.2.1819: Vim9: Memory leak when using a closure
Problem: Vim9: Memory leak when using a closure.
Solution: Compute the mininal refcount in the funcstack. Reenable disabled
tests.
diff --git a/src/structs.h b/src/structs.h
index e7b72de..0a3d524 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1869,8 +1869,11 @@
// - arguments
// - frame
// - local variables
+ int fs_var_offset; // count of arguments + frame size == offset to
+ // local variables
int fs_refcount; // nr of closures referencing this funcstack
+ int fs_min_refcount; // nr of closures on this funcstack
int fs_copyID; // for garray_T collection
} funcstack_T;