next up previous contents
Next: 8.4 Alien Variables Up: 8.3 Alien Operations Previous: 8.3.2 Alien Coercion Operations

8.3.3 Alien Dynamic Allocation

Dynamic Aliens are allocated using the malloc library, so foreign code can call free on the result of make-alien, and Lisp code can call free-alien on objects allocated by foreign code.

[Macro]
alien: make-alien type tex2html_wrap_inline17166sizetex2html_wrap_inline17168

This macro returns a dynamically allocated Alien of the specified type (which is not evaluated.) The allocated memory is not initialized, and may contain arbitrary junk. If supplied, size is an expression to evaluate to compute the size of the allocated object. There are two major cases:

[Function]
alien: free-alien alien

This function frees the storage for alien (which must have been allocated with make-alien or malloc.)

See also  with-alien (page gif), which stack-allocates Aliens.



Raymond Toy
Mon Jul 14 09:11:27 EDT 1997