Class: FFI::Type::Builtin

Inherits:
FFI::Type show all
Defined in:
ext/ffi_c/Type.c,
ext/ffi_c/Type.c

Overview

Class for Built-in types.

Constant Summary

Constants inherited from FFI::Type

Struct

Instance Method Summary collapse

Methods inherited from FFI::Type

#alignment, #initialize, #size

Constructor Details

This class inherits a constructor from FFI::Type

Instance Method Details

#inspectString

Inspect FFI::Type::Builtin object.

Returns:

  • (String)


213
214
215
216
217
218
219
220
221
222
223
224
# File 'ext/ffi_c/Type.c', line 213

static VALUE
builtin_type_inspect(VALUE self)
{
    char buf[100];
    BuiltinType *type;

    TypedData_Get_Struct(self, BuiltinType, &builtin_type_data_type, type);
    snprintf(buf, sizeof(buf), "#<%s::%s size=%d alignment=%d>",
            rb_obj_classname(self), type->name, (int) type->type.ffiType->size, type->type.ffiType->alignment);

    return rb_str_new2(buf);
}