-
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.
Add a test to reproduce the issue. Remove the assertion.
- Loading branch information
Showing
6 changed files
with
34 additions
and
3 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,17 @@ | ||
use crate::api::*; | ||
use mmtk::util::OpaquePointer; | ||
use mmtk::Allocator; | ||
|
||
#[test] | ||
pub fn issue139_alloc_non_multiple_of_min_alignment() { | ||
gc_init(200*1024*1024); | ||
let handle = bind_mutator(OpaquePointer::UNINITIALIZED); | ||
|
||
// Allocate 6 bytes with 8 bytes ailgnment required | ||
let addr = alloc(handle, 6, 8, 0, Allocator::Default); | ||
assert!(addr.is_aligned_to(8)); | ||
// After the allocation, the cursor is not MIN_ALIGNMENT aligned. If we have the assertion in the next allocation to check if the cursor is aligned to MIN_ALIGNMENT, it fails. | ||
// We have to remove that assertion. | ||
let addr2 = alloc(handle, 6, 8, 0, Allocator::Default); | ||
assert!(addr2.is_aligned_to(8)); | ||
} |
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,4 @@ | ||
// Each module should only contain one #[test] function. | ||
// We should run each module in a separate test process, as we do not have proper | ||
// setup/teardown procedure for MMTk instances. | ||
mod issue139; |