Next Previous Up Top Contents Index

1.5 Designator classes

size-of

Function

Summary

Takes a designator class and returns the size of the C type that the class designates.

Signature

size-of designator-class => size 

Arguments

designator-class
A subclass of <C-value>.

Values

size
An instance of <integer>.

Library

c-ffi

Module

c-ffi

Description

Takes a designator class and returns the size of the C type that the class designates.

The size-of function can be applied to any designator class. However, if it is applied to <C-void>, <C-value>, or <C-struct>, it returns zero. It corresponds to C's sizeof operator and returns an integer, size, in the same units as sizeof does on the target platform. It can be useful when allocating a C object whose declared size is not accurate and has to be adjusted manually.


C FFI and Win 32 Reference - 31 MAR 2000

Next Previous Up Top Contents Index