Next: , Previous: , Up: iklib pointers   [Index]


6.45.5 Miscellaneous operations

The following bindings are exported by the libraries (vicare) and (vicare system $foreign) and reexported by the library (vicare ffi).

Function: set-pointer-null! pointer

Mutate the pointer object pointer to represent the NULL pointer.

Function: pointer-diff ptr1 ptr2

Return an exact integer representing the difference between the two pointer objects ptr1 and ptr2. The returned value is such that:

(pointer=? P (pointer-add Q (pointer-diff P Q)))
⇒ #t
Function: pointer-add ptr diff

Return a new pointer object holding the memory reference resulting from adding diff, which must be an exact integer, to ptr. If the addition would cause an overflow or underflow in machine words: raise an assertion violation.