neovim/neovim — pull request #1761 by oni-link (2014-12-31 16:27:13+00:00)
Title: [RFC] Speed up garbage collection (Issue 1687).

Speed up garbage collection. (Issue https://github.com/neovim/neovim/issues/1687)

For garbage collection all lists are kept in first_list, a list of all
lists.

free_unref_items() searches through first_list and removes unreferenced
lists from it (by calling list_free(..., FALSE)). But after a list was
removed, the search continues from the beginning of first_list (not sure
how many lists were really removed and where to continue in first_list).

This is not necessary anymore since vim-patch [7.0.135](https://code.google.com/p/vim/source/detail?r=v7-0-135) , because a call to
list_free(...,FALSE) makes sure, that no other lists (and dictionaries)
are freed. So we always know, that the next list in first_list is
still valid (allocated or NULL) and can be used to continue the search.

Likewise for dictionaries.

Original patch by Ariya Mizutani
https://groups.google.com/forum/#!searchin/vim_dev/GC/vim_dev/DBYOdHQWvqY/1WH04_dwETIJ