All Manuals > LispWorks Foreign Language Interface User Guide and Reference Manual > 5 Function and Macro Reference

NextPrevUpTopContentsIndex

foreign-block-copy

Function
Summary

Makes a copy of a foreign block, in LispWorks for Macintosh.

Package

fli

Signature

foreign-block-copy foreign-block => new-foreign-block

Arguments

foreign-block

A foreign block pointer.

Results

new-foreign-block A foreign block pointer.

Description

The function foreign-block-copy makes and returns a copy of the foreign block foreign-block . It corresponds to the C function _Block_copy .

foreign-block can be any foreign block.

The result of the copy is another foreign block with an indefinite scope, which has the same attributes as foreign-block . In other words, invoking the copy invokes the same function.

The new foreign block cannot be garbage collected. It should be freed when you are finished with it by foreign-block-release.

foreign-block-copy is not expected to be commonly useful. You need it when you get passed block and you want to use it outside the scope of the call in which it was passed, unless it is documented that the block is global.

Notes

If you use new-foreign-block with a function that is documented to release the block, you must not call foreign-block-release on it. However, we do not expect this situation to happen, because a proper interface will only free blocks that it allocates.

Notes

foreign-block-copy is implemented in LispWorks for Macintosh only.

See also

foreign-block-release
Block objects in C (foreign blocks)


LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011

NextPrevUpTopContentsIndex