-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extra assertions for mutators and epilogues (#1182)
This commit adds assertions about the number of mutators and the list of mutators returned from the VM binding. Also asserts that epilogues are not silently dropped before they are executed. It could happen if a buggy VM binding returns a number of mutators that does not match the actual list of mutators. This should detect bugs like mmtk/mmtk-ruby#84
- Loading branch information
Showing
6 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//! Utilities for implementing epilogues. | ||
//! | ||
//! Epilogues are operations that are done when several other operations are done. | ||
|
||
use std::sync::atomic::{AtomicUsize, Ordering}; | ||
|
||
/// A debugging method for detecting the case when the epilogue is never executed. | ||
pub fn debug_assert_counter_zero(counter: &AtomicUsize, what: &'static str) { | ||
let value = counter.load(Ordering::SeqCst); | ||
if value != 0 { | ||
panic!("{what} is still {value}."); | ||
} | ||
} |
This file contains 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