forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from jacob-hughes/memaligned_malloc
Use GC_memalign for larger allocations
- Loading branch information
Showing
4 changed files
with
66 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use std::gc::GcAllocator; | ||
|
||
#[repr(align(1024))] | ||
struct S(u8); | ||
|
||
#[test] | ||
fn large_alignment() { | ||
let x = Box::new_in(S(123), GcAllocator); | ||
let ptr = Box::into_raw(x); | ||
assert!(!ptr.is_null()); | ||
assert!(ptr.is_aligned()); | ||
} |
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 |
---|---|---|
|
@@ -56,6 +56,7 @@ mod c_str; | |
mod const_fns; | ||
mod cow_str; | ||
mod fmt; | ||
mod gc; | ||
mod heap; | ||
mod linked_list; | ||
mod rc; | ||
|
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