Closed jameslahm closed 3 years ago
Test result | Dev count | PR count | Difference |
---|---|---|---|
Total | 79,437 | 79,437 | 0 |
Passed | 18,192 | 18,196 | +4 |
Ignored | 24,388 | 24,388 | 0 |
Failed | 36,813 | 36,809 | -4 |
Panics | 44 | 44 | 0 |
Conformance | 22.90 | 22.91 | +0.01% |
yeah, that makes sense. I have changed VM_NATIVE_REFERENCES to be immutable. And now there is no other way to add native references in runtime. Native references only in VM_NATIVE_REFERENCES or in external references. I move native references in separate structs mainly to make maintaining native references easier, avoiding the need to copy functions in VM_NATIVE_REFERENCES each time we implement a new function. And VM_NATIVE_REFERENCES only be initialized in the lazy static function, and will not be changed in runtime.
Moving native references to separate structs does not look good. It should always be in one large array. External references can be passed at VM instance creation time and there should be no other way to add them at runtime: only when VM instance is created or in VM_NATIVE_REFERENCES global array.