with-out-parameters ( c-types quot -- values... )
Factor handbook » C library interface » Passing data between Factor and C » Output parameters in C


Vocabulary
alien.data

Inputs
c-typesa list of scoped allocation specifiers
quota quotation


Outputs
values...zero or more values


Word description
Allocates values on the call stack, calls the quotation, then copies all stack allocated values to the data heap after the quotation returns.

A scoped allocation specifier is either:
a C type name,
or a triple with shape { c-type initial: initial }, where c-type is a C type name and initial is a literal value.

If no initial value is specified, the contents of the allocated memory are undefined.

Warning
Reading or writing a scoped allocation buffer outside of the given quotation will cause memory corruption.


Definition