<displaced-alien> ( displacement c-ptr -- alien )
Factor handbook > C library interface > Passing data between Factor and C > Passing pointers to C functions > Alien addresses

Prev:<alien> ( address -- alien )
Next:alien-address ( c-ptr -- addr )


Inputs and outputs
displacementan integer
c-ptra c-ptr
aliena new alien

Word description
Creates a new alien address object, wrapping a raw memory address. The alien points to a location in memory which is offset by displacement from the address of c-ptr.

Passing a value of f for c-ptr creates an alien with an absolute address; this is how <alien> is implemented.

Passing a zero absolute address does not construct a new alien object, but instead makes the word output f.

See also
<alien>, alien-address


PRIMITIVE: <displaced-alien> ( displacement c-ptr -- alien )