Skip to content
Permalink
Browse files

late-bind standalone target_family

  • Loading branch information...
arcnmx committed Nov 2, 2015
1 parent f22dfce commit 30d290f6cd456bf64a5be0930463dc7525ab4a90
Showing with 1,204 additions and 0 deletions.
  1. +26 −0 src/liballoc_system/lib.rs
  2. +1,176 −0 src/libstd/sys/bind.rs
  3. +2 −0 src/libstd/sys/mod.rs
@@ -23,6 +23,7 @@
#![feature(no_std)]
#![feature(staged_api)]

#[cfg(any(unix, windows))]
extern crate libc;

// The minimum alignment guaranteed by the architecture. This value is used to
@@ -230,3 +231,28 @@ mod imp {
size
}
}

#[cfg(target_family = "bind")]
mod imp {
extern "C" {
pub fn __rust_bind_alloc_allocate(size: usize, align: usize) -> *mut u8;
pub fn __rust_bind_alloc_reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8;
pub fn __rust_bind_alloc_reallocate_inplace(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> usize;
pub fn __rust_bind_alloc_deallocate(ptr: *mut u8, size: usize, align: usize);
pub fn __rust_bind_alloc_usable_size(size: usize, align: usize) -> usize;
}

pub use self::{
__rust_bind_alloc_allocate as allocate,
__rust_bind_alloc_reallocate as reallocate,
__rust_bind_alloc_reallocate_inplace as reallocate_inplace,
__rust_bind_alloc_deallocate as deallocate,
};

#[inline(always)]
pub fn usable_size(size: usize, align: usize) -> usize {
unsafe {
__rust_bind_alloc_usable_size(size, align)
}
}
}
Oops, something went wrong.

0 comments on commit 30d290f

Please sign in to comment.
You can’t perform that action at this time.