| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version |
Arguments: type
This function returns how much prepadding is done for a
:lisp
allocated instance of the argument
type. The type can be a
symbol naming the type or an expression to define the type, as in:
(ff:foreign-type-lisp-pre-padding '(:struct (a :int) (b :double)))
:lisp
allocated foreign structures are allocated in
Lisp arrays of element type (unsigned-byte 8)
. Due
to alignment requirements of the structure being defined and of the
processor on which Lisp is running, some structures may be stored in
the Lisp array beginning at an index other than zero.
For example this type, created by a call to def-foreign-type,
(def-foreign-type foo (:struct (d :double) (i :int)))
will start at index 4 in the Lisp array when running on the Sparc
processor but at index 0 in the Lisp array when running on the Intel
x86 architecture. foreign-type-lisp-pre-padding
applied to (:struct (d :double) (i :int))
, thus,
returns 4 when run on an Intel x86 box and 0 when run on a Sparc box.
See ftype.htm for information on foreign types in Allegro CL and foreign-functions.htm for general information on foreign functions in Allegro CL.
Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version |