On 11/8/19 7:22 PM, Jacek Caban wrote:
Hi Gabriel,
On 11/8/19 4:48 PM, Gabriel Ivăncescu wrote:
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
Unfortunately we still need the 'global_vars' field in vbscode_t, because we have to allocate it only once, but the script can be executed multiple times.
It is still created when compiling the script. An alternative is to create it on first execution, but I don't think it's worth it, as it complicates the code slightly. We'd still need the field though, for possible subsequent executions.
Why can't we do that on each execution? We'd need to free it when going to unintialized state, but that seems fine.
+ dynamic_var_t *global_vars;
As above, I still don't see why you need it.
Right. Now that I actually made these changes I realized this can simplify the patch that moves the global lists to the script dispatch a bit, too, since we'll tie them to the dispatch object's heap.
+ function_t *funcs; + class_desc_t *classes;
With those being here, there is no point in having it duplicated in compiler context. I think we could remove it from there.
Sure I'll make separate patches for these.
Thanks, Gabriel