feat: add casting of fundamental types to memory mapping#140
feat: add casting of fundamental types to memory mapping#140Wodann merged 5 commits intomun-lang:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #140 +/- ##
==========================================
+ Coverage 81.80% 82.06% +0.26%
==========================================
Files 159 160 +1
Lines 10672 10806 +134
==========================================
+ Hits 8730 8868 +138
+ Misses 1942 1938 -4
Continue to review full report at Codecov.
|
|
@baszalmstra any comments on the discussion topics in this description? |
The HasStaticTypeInfo trait and FunctionInfoStorage struct are closely related to the ABI, and multiple crates depend on them. Hence, it was decided to move them up the dependency chain to mun_abi.
I'd say that it should never
No, I don't think we should ever |
|
I'll add a commit to init to zero, in that case 👌🏻 |
|
I've updated the PR description to reflect that we decided to never Could you review that commit please @baszalmstra ? |
Adds support for fundamental type conversions, when memory mapping. E.g. going from this struct:
to the following struct, is legal:
[Discussion] Non-guaranteed type conversions will result in
azero initialization. Is this desirable? Potentially we could at least attempt the conversion and onlypaniczero initialize if thepanic!try_intocall fails.[Discussion]
Non-legal or failed type conversions will result in aAlternatives are:panic!. Is this desirable?Assembly. Changes will have to be made to the source code before we re-evaluate theAssembly. This means that you can never "reuse" a field by doing an illegal conversion. This might force people to take a two-step hot reloading approach: i.e. remove first and then add the new field.Edit: after discussion, we decided to never panic. If we cannot resolve the type conversion, we continue with the mapping - assuming zero initialization.