<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 )


Vocabulary
alien

Inputs
displacementan integer
c-ptra c-ptr


Outputs
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.

Notes
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

Definition

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