Hi Jacek,
On 10/30/19 4:20 PM, Jacek Caban wrote:
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
Sorry I'm not sure I understand. vbscode_t already stores the list of its own global variables and functions.
They just get linked to the script_ctx_t lists when they are being executed (after this patch series, now it's when they are compiled which is wrong).
The only alternative I can think of is to copy the variables/functions over when adding them to the context/dispatch globals. Unlinking them is, IMO, simpler than copying but that's just me.
If we replace them with arrays this won't really change the fact we'll have to make copies. Is that what you have in mind?