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.



172
173
174
175
176
177
178
179
180
181
182
183
# File 'ext/ffi_c/Type.c', line 172

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

    Data_Get_Struct(self, BuiltinType, 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);
}