rustc: Implement ptr_eq in Rust. Shaves 4 s off compile time.

This commit is contained in:
Patrick Walton 2011-07-20 19:34:52 -07:00
parent 355f77ef87
commit 45748a3be4

View File

@ -1,8 +1,8 @@
export ptr_eq;
native "rust" mod rustrt {
fn rust_ptr_eq[T](@T a, @T b) -> int;
fn ptr_eq[T](&@T a, &@T b) -> bool {
let uint a_ptr = unsafe::reinterpret_cast(a);
let uint b_ptr = unsafe::reinterpret_cast(b);
ret a_ptr == b_ptr;
}
fn ptr_eq[T](@T a, @T b) -> bool { ret rustrt::rust_ptr_eq[T](a, b) != 0; }