Skip to content

Conversation

@greenhat
Copy link
Contributor

@greenhat greenhat commented Jul 5, 2024

This PR is stacked on the #233 and should be merged after it

@greenhat greenhat changed the title Fix memory cleanup in Emulator::stop [7/x] Fix memory cleanup in Emulator::stop Jul 5, 2024
@greenhat greenhat requested a review from bitwalker July 5, 2024 14:01
self.callstack.clear();
self.stack.clear();
self.memory.clear();
self.memory = vec![Self::EMPTY_WORD; self.memory.len()];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.memory = vec![Self::EMPTY_WORD; self.memory.len()];
self.memory.fill(Self::EMPTY_WORD);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! In #237, I reworked it completely (it only cleans "dirty" addresses).

Copy link
Collaborator

@bitwalker bitwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested one minor change, but otherwise looks good - well spotted!

@greenhat greenhat force-pushed the greenhat/vm-trace-itests branch 3 times, most recently from 625304e to f39e23b Compare July 17, 2024 12:31
@greenhat greenhat force-pushed the greenhat/fix-emu-mem-clean branch from e42373f to effc46b Compare July 17, 2024 12:39
@greenhat greenhat force-pushed the greenhat/fix-emu-mem-clean branch from effc46b to 8aea8fe Compare July 17, 2024 12:40
Base automatically changed from greenhat/vm-trace-itests to main July 17, 2024 13:10
@greenhat greenhat merged commit 9bd4086 into main Jul 17, 2024
@greenhat greenhat deleted the greenhat/fix-emu-mem-clean branch July 17, 2024 13:11
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.

3 participants