Method: FFI::Pointer#+
- Defined in:
- ext/ffi_c/Pointer.c
#+(offset) ⇒ Pointer
Return a new FFI::Pointer from an existing pointer and an offset
.
234 235 236 237 238 239 240 241 242 243 |
# File 'ext/ffi_c/Pointer.c', line 234
static VALUE
ptr_plus(VALUE self, VALUE offset)
{
AbstractMemory* ptr;
long off = NUM2LONG(offset);
TypedData_Get_Struct(self, AbstractMemory, &rbffi_abstract_memory_data_type, ptr);
return slice(self, off, ptr->size == LONG_MAX ? LONG_MAX : ptr->size - off);
}
|