about summary refs log tree commit diff
path: root/src/libcore/box.rs
blob: 23b5889bc6a4e5f6ce31574dec81e5841e47f716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
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;
    }
}