21 lines
343 B
Rust
21 lines
343 B
Rust
/*
|
|
Module: box
|
|
*/
|
|
|
|
|
|
export ptr_eq;
|
|
|
|
/*
|
|
Function: ptr_eq
|
|
|
|
Determine if two shared boxes point to the same object
|
|
*/
|
|
pure fn ptr_eq<T>(a: @T, b: @T) -> bool {
|
|
// FIXME: ptr::addr_of
|
|
unsafe {
|
|
let a_ptr: uint = unsafe::reinterpret_cast(a);
|
|
let b_ptr: uint = unsafe::reinterpret_cast(b);
|
|
ret a_ptr == b_ptr;
|
|
}
|
|
}
|