This commit is contained in:
parent
2107b9edb3
commit
90958a96ee
2 changed files with 3 additions and 6 deletions
|
@ -2,7 +2,7 @@ use crate::spec::{Target, TargetMetadata, base};
|
|||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::os::opts();
|
||||
base.cpu = "x86-64".into();
|
||||
base.cpu = "x86-64-v2".into();
|
||||
Target {
|
||||
llvm_target: "x86_64-unknown-none".into(),
|
||||
metadata: TargetMetadata {
|
||||
|
|
|
@ -19,11 +19,8 @@ unsafe impl GlobalAlloc for System {
|
|||
}
|
||||
let num_blocks =
|
||||
if layout.size() % 16 == 0 { layout.size() / 16 } else { (layout.size() / 16) + 1 };
|
||||
HEAP_USED.fetch_add(num_blocks, Ordering::Relaxed);
|
||||
let ptr = unsafe {
|
||||
ptr::addr_of_mut!(HEAP_DATA.0[HEAP_USED.load(Ordering::Relaxed) - num_blocks])
|
||||
as *mut u8
|
||||
};
|
||||
let heap_used = HEAP_USED.fetch_add(num_blocks, Ordering::SeqCst);
|
||||
let ptr = unsafe { ptr::addr_of_mut!(HEAP_DATA.0[heap_used * 16]) as *mut u8 };
|
||||
ptr
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue