Method: FFI::AbstractMemory#clear

Defined in:
ext/ffi_c/AbstractMemory.c

#clearself

Set the memory to all-zero.

Returns:

  • (self)


315
316
317
318
319
320
321
322
# File 'ext/ffi_c/AbstractMemory.c', line 315

static VALUE
memory_clear(VALUE self)
{
    AbstractMemory* ptr = MEMORY(self);
    checkWrite(ptr);
    memset(ptr->address, 0, ptr->size);
    return self;
}