Arguments: type &optional allocation size
Allocate an object of the given type in heap described by the allocation argument. If the size argument is given, then it is the minimum size (in bytes) of the data portion of the object that will be allocated. The valid allocation argument values are as follows (default is :foreign). type should be a type defined with def-foreign-type.
aclmalloc). Unlike other objects allocated in static space, these objects are automatically gc'ed (the C
aclfreefunction is called on them) when the last pointer to them in the Lisp heap disappears. The advantage of this allocation type over
:foreignis that the object doesn't move. This makes it very useful when the object must be passed to a C foreign-function that releases the heap (e.g. most functions in the Windows package).
:lispand then call read-sequence to read the data from the binary file into the foreign object. Note, however, that read-sequence will also work for
:foreignallocated objects. There is one tricky case: if the foreign structure requires 8 byte alignment (e.g. it begins with a double float) then the first four bytes of the lisp array allocated will not be used by fslot-value-typed. If you read-sequence into such an array, then your data will be displaced 4 bytes from where fslot-value-typed thinks it is.
:aligned- This is just like
:cexcept that it returns an aligned pointer.
See ftype.htm for information on foreign types in Allegro CL and foreign-functions.htm for general information on foreign functions in Allegro CL.
The documentation is described in introduction.htm and the index is in index.htm.
Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.