Convert some Process code to Rust#2651
Merged
sporksmith merged 19 commits intoshadow:mainfrom Jan 13, 2023
Merged
Conversation
Codecov ReportBase: 67.90% // Head: 67.70% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2651 +/- ##
==========================================
- Coverage 67.90% 67.70% -0.21%
==========================================
Files 202 202
Lines 30112 30289 +177
Branches 5856 5906 +50
==========================================
+ Hits 20449 20508 +59
- Misses 5032 5126 +94
- Partials 4631 4655 +24
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
7b750f8 to
acaadf0
Compare
acaadf0 to
00e5254
Compare
00e5254 to
fefdafc
Compare
stevenengler
approved these changes
Jan 12, 2023
I can't think of a reason we currently need it, and tests pass without it. I think it *might* previously have been needed when working with ptrace.
Was going to do all of it, but I'm pretty sure I'll need to wrap the threads in `RootedRc<RootedRefCell<_>>` first, so stopping to do that now.
The `RootedRc` lets us hold a reference to a thread without holding a reference to the thread list. `ThreadRef` currently has mutable methods, so we need to be able to get a mutable reference, so we use `RootedRefCell`. We could end up dropping this if we change `ThreadRef` to use internal mutability everywhere as we do with Process and Host.
Next tricky bit is setting up the thread's shared memory block.
This is where it more-properly belongs, and unblocks moving more Process code to Rust.
741b003 to
bd63065
Compare
If there could be non-running threads in the thread table, the code would fail in a somewhat confusing way. Simplify the code to more explicitly depend on the assumption that there are none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stopped at a fairly arbitrary point just to sync up.