Method: FFI::AbstractMemory#__copy_from__

Defined in:
ext/ffi_c/AbstractMemory.c

#__copy_from__(rbsrc, rblen) ⇒ Object



681
682
683
684
685
686
687
688
689
690
691
# File 'ext/ffi_c/AbstractMemory.c', line 681

static VALUE
memory_copy_from(VALUE self, VALUE rbsrc, VALUE rblen)
{
    AbstractMemory* dst;

    TypedData_Get_Struct(self, AbstractMemory, &rbffi_abstract_memory_data_type, dst);

    memcpy(dst->address, rbffi_AbstractMemory_Cast(rbsrc, &rbffi_abstract_memory_data_type)->address, NUM2INT(rblen));

    return self;
}