with-foreign-object
— Wraps the allocation of a foreign object around a body of code.
(with-foreign-object
(var type)
&body
body)
|
The variable name to bind. |
|
The type of foreign object to allocate. This parameter is evaluated. |
returns |
The result of evaluating the |
This function wraps the allocation, binding, and destruction of a foreign object. On CMUCL and Lispworks platforms the object is stack allocated for efficiency. Benchmarks show that AllegroCL performs much better with static allocation.