Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: cleanup runtime/memory code #142

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

Wodann
Copy link
Collaborator

@Wodann Wodann commented Apr 28, 2020

Depends on #140.

@Wodann Wodann requested a review from baszalmstra April 28, 2020 16:32
@Wodann Wodann self-assigned this Apr 28, 2020
@codecov
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #142 into master will decrease coverage by 0.08%.
The diff coverage is 80.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
- Coverage   82.06%   81.98%   -0.09%     
==========================================
  Files         160      160              
  Lines       10806    10816      +10     
==========================================
- Hits         8868     8867       -1     
- Misses       1938     1949      +11     
Impacted Files Coverage Δ
crates/mun_runtime/src/struct.rs 76.80% <40.74%> (-9.32%) ⬇️
crates/mun_memory/src/mapping.rs 93.22% <86.20%> (-4.15%) ⬇️
crates/mun_memory/src/gc/mark_sweep.rs 86.55% <96.00%> (-0.16%) ⬇️
crates/mun_runtime/src/assembly.rs 63.63% <100.00%> (+2.45%) ⬆️
crates/mun_runtime/src/garbage_collector.rs 93.18% <100.00%> (+2.79%) ⬆️
crates/mun_runtime/src/lib.rs 72.04% <100.00%> (+0.30%) ⬆️
crates/mun_runtime/src/reflection.rs 54.34% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecca852...5be9d5c. Read the comment docs.

@baszalmstra
Copy link
Collaborator

Looks nice, one questions: Would it be possible to add unsafe casting when hotloading? From u128 to u64 for example?

@Wodann
Copy link
Collaborator Author

Wodann commented Apr 29, 2020

Looks nice, one questions: Would it be possible to add unsafe casting when hotloading? From u128 to u64 for example?

@baszalmstra Yes, as I mentioned in the first discussion topic of PR #140, we can add non-guaranteed (or unsafe) casts, but when those fail they would result in zeroed memory. Would you be happy with that? If so, I'll create a new PR for that specific case.

@baszalmstra
Copy link
Collaborator

If a warning is emitted for that as well, that would be totally fine by me! :)

Wodann added 2 commits April 29, 2020 23:16
The MemoryMapper trait now receives a pre-calculated mapping, reducing
the implementation size for anyone implementing the trait.
Garbage collection uses TypeInfo pointers that cannot directly be
linked to the lifetime of their assemblies. As a result any usage of
these pointers is unsafe. To clarify this, the RawTypeInfo type has been
renamed to UnsafeTypeInfo and everywhere it is used, unsafe must be
added, similar to Rust's UnsafeCell type.
@Wodann Wodann force-pushed the refactor/runtime-cleanup branch from 1e15f48 to 5be9d5c Compare April 29, 2020 21:17
@Wodann Wodann merged commit dfd26e8 into mun-lang:master Apr 29, 2020
@Wodann Wodann changed the title cleanup runtime/memory code refactor: cleanup runtime/memory code May 2, 2020
@Wodann Wodann added this to the Mun v0.2 milestone May 14, 2020
@Wodann Wodann deleted the refactor/runtime-cleanup branch May 14, 2020 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants