Test whether two pointers point to the same memory address.
fli
pointer-eq pointer1 pointer2 => boolean
pointer1⇩ |
A FLI pointer. |
pointer2⇩ |
A FLI pointer. |
boolean |
A boolean. |
The function pointer-eq
tests whether pointer1 points to the same address as pointer2 and returns t
if they do, and nil
if they do not.
In the following example a pointer, point1
, is defined, and point2
is set equal to it. Both are then tested to see if they are equal to each other using pointer-eq
. Then point2
is defined to point to a different object, and the two pointers are tested for equality again.
(setq point1 (fli:allocate-foreign-object :type :int))
(setq point2 point1)
(fli:pointer-eq point1 point2)
(setq point2 (fli:allocate-foreign-object :type :int))
(fli:pointer-eq point1 point2)
Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58