FunctionPackage: ffToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

foreign-type-lisp-pre-padding

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-2012, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 9.0. This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version