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

sizeof-fobject

Arguments: ftype

This function returns the size of an object of the given foreign type. The argument ftype can be an ftype or a name of a foreign type or certain kinds of fobjects. (fobjects are the objects that result from a call to ff:allocate-fobject and related functions.) Only fobjects of allocation type :foreign or :foreign-static-gc can be arguments to this function. fobjects of allocation types :lisp, :lisp-short, :c, and :aligned cannot be arguments. The allocation type is defined when the object is created. Note that objects of allocation type :lisp have their own lisp types, and thus do not imply a foreign-type; and objects of :c allocation are just integers, and thus again do not imply a foreign-type.

The size only includes the data bytes and not any overhead bytes needed by lisp.

Example

cl-user(1): (ff:def-foreign-type point (:struct (x :int) (y :int)))
#<foreign-functions::foreign-structure point>
cl-user(2): (setq obj (ff:allocate-fobject 'point :foreign-static-gc))
#<foreign object of class point>
cl-user(3): (ff:sizeof-fobject 'point)
8
cl-user(4): (ff:sizeof-fobject (ff:get-foreign-type 'point))
8
cl-user(5): (ff:sizeof-fobject obj)
8
cl-user(6): 

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-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

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