Hi Gabriel,
This patch adds extra complexity for unlinking. However, I imagine that once you change the representation of global functions and variables, they will not be needed. We'd probably need such list inside vbscode_t, but it will never be linked/unlinked to a global list (global list will in fact not exist).
I would expect that it would be easier to first replace lists with arrays inside script_ctx_t and consider moving things to script dispatch later.
Thanks,
Jacek