I missed a couple files in the first patch; updated patch attached.
I still need help with the LUA interface.
>
> First, if I don't use :unlet dict list, but instead source the script
> again and allow the previous values to be garbage collected, Vim stays
> busy for at least an hour. I don't know if it ever finishes because I
> killed the process. I used gdb on MinGW to see that Vim DOES get
> through the "set reference" calls in the garbage collector which my
> patch fixed; so I expect Vim is busy with the recursive calls to
> actually free the garbage-collected memory. These could probably be
> fixed in the same way I fixed the reference setting recursion. I think
> this deserves a separate patch.
>
Unfortunately I tried the same approach with the list_free and dict_free chains and there did not seem to be a usable impact on performance. I let it run for half an hour and Vim was still busy...but it did finally finish sometime after I went to bed, so I guess there is that.
You're welcome! I'm seeing crashes from time to time at work when Vim
isn't really actively doing much of anything, so I figured this stood
some chance of being the cause.
I have not checked in valgrind, because I've never used it before, and I
developed the patch on Windows. I do have a Ubuntu dual-boot, I'll try
logging in and seeing how well I can follow the instructions in the
makefile later this week. Thanks for pointing them out!
Do you have input on the 3 questions I had about aborting the collection
when malloc fails?
1. Does there need to be any user notification of the aborted garbage
collection?
2. Do I need to set any of the garbage collect flags when aborting
collection due to failure in the setup?
3. How to get a return value from LUA interface, to allow aborting if it
fails?