The following operations can be used to peek into memory. They can be
used in conjunction with the foreign interface to peek into data
structures within foreign code from Prolog. These operations take an
integer argument and access the data stored at the address represented
by the argument. Note that these operations can result in
segmentation faults and bus errors if the argument you are trying to
access is a bad address or if the address is not aligned properly for
the data you are going to access from it. The only sure way of
getting an integer in Prolog that represents an address that makes
sense is by returning an address from a foreign function through the
foreign language interface (see fli-p2f-poi). For
built-ins that poke ("store") values into memory, see the reference
page for assign/2
in the reference section. For more structured
ways of doing this, see the Structs and Objects packages.
integer_8_at(
X)
unsigned_8_at(
X)
integer_16_at(
X)
unsigned_16_at(
X)
integer_at(
X)
address_at(
X)
single_at(
X)
double_at(
X)