rt: Remove size_of and align_of functions. Now written in Rust

This commit is contained in:
Brian Anderson 2011-11-17 14:22:40 -08:00
parent a9f7cbe240
commit 9ca2005959
3 changed files with 4 additions and 18 deletions

View file

@ -16,8 +16,6 @@ native mod rustrt {
// available outside this crate. Otherwise it's
// visible-in-crate, but not re-exported.
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 do_gc();
fn unsupervise();
@ -52,8 +50,8 @@ Function: size_of
Returns the size of a type
*/
fn size_of<T>() -> uint {
ret rustrt::size_of(get_type_desc::<T>());
fn size_of<T>() -> uint unsafe {
ret (*get_type_desc::<T>()).size;
}
/*
@ -61,8 +59,8 @@ Function: align_of
Returns the alignment of a type
*/
fn align_of<T>() -> uint {
ret rustrt::align_of(get_type_desc::<T>());
fn align_of<T>() -> uint unsafe {
ret (*get_type_desc::<T>()).align;
}
/*

View file

@ -75,16 +75,6 @@ void squareroot(double *input, double *output) {
*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
leak(void *thing) {
// Do nothing. Call this with move-mode in order to say "Don't worry rust,

View file

@ -1,5 +1,4 @@
__morestack
align_of
chan_id_send
check_claims
debug_box
@ -50,7 +49,6 @@ rust_task_sleep
rust_get_task
set_min_stack
sched_threads
size_of
squareroot
start_task
vec_reserve_shared