rt: Remove size_of and align_of functions. Now written in Rust
This commit is contained in:
@@ -16,8 +16,6 @@ native mod rustrt {
|
|||||||
// available outside this crate. Otherwise it's
|
// available outside this crate. Otherwise it's
|
||||||
// visible-in-crate, but not re-exported.
|
// visible-in-crate, but not re-exported.
|
||||||
fn last_os_error() -> str;
|
fn last_os_error() -> str;
|
||||||
fn size_of(td: *type_desc) -> uint;
|
|
||||||
fn align_of(td: *type_desc) -> uint;
|
|
||||||
fn refcount<T>(t: @T) -> uint;
|
fn refcount<T>(t: @T) -> uint;
|
||||||
fn do_gc();
|
fn do_gc();
|
||||||
fn unsupervise();
|
fn unsupervise();
|
||||||
@@ -52,8 +50,8 @@ Function: size_of
|
|||||||
|
|
||||||
Returns the size of a type
|
Returns the size of a type
|
||||||
*/
|
*/
|
||||||
fn size_of<T>() -> uint {
|
fn size_of<T>() -> uint unsafe {
|
||||||
ret rustrt::size_of(get_type_desc::<T>());
|
ret (*get_type_desc::<T>()).size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -61,8 +59,8 @@ Function: align_of
|
|||||||
|
|
||||||
Returns the alignment of a type
|
Returns the alignment of a type
|
||||||
*/
|
*/
|
||||||
fn align_of<T>() -> uint {
|
fn align_of<T>() -> uint unsafe {
|
||||||
ret rustrt::align_of(get_type_desc::<T>());
|
ret (*get_type_desc::<T>()).align;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -75,16 +75,6 @@ void squareroot(double *input, double *output) {
|
|||||||
*output = sqrt(*input);
|
*output = sqrt(*input);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CDECL size_t
|
|
||||||
size_of(type_desc *t) {
|
|
||||||
return t->size;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" CDECL size_t
|
|
||||||
align_of(type_desc *t) {
|
|
||||||
return t->align;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" CDECL void
|
extern "C" CDECL void
|
||||||
leak(void *thing) {
|
leak(void *thing) {
|
||||||
// Do nothing. Call this with move-mode in order to say "Don't worry rust,
|
// Do nothing. Call this with move-mode in order to say "Don't worry rust,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
__morestack
|
__morestack
|
||||||
align_of
|
|
||||||
chan_id_send
|
chan_id_send
|
||||||
check_claims
|
check_claims
|
||||||
debug_box
|
debug_box
|
||||||
@@ -50,7 +49,6 @@ rust_task_sleep
|
|||||||
rust_get_task
|
rust_get_task
|
||||||
set_min_stack
|
set_min_stack
|
||||||
sched_threads
|
sched_threads
|
||||||
size_of
|
|
||||||
squareroot
|
squareroot
|
||||||
start_task
|
start_task
|
||||||
vec_reserve_shared
|
vec_reserve_shared
|
||||||
|
|||||||
Reference in New Issue
Block a user