Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
IO::Buffer::Storage#mapped?
mapped? → true or false
io_buffer.c
View on GitHub ↗
static VALUE
rb_io_buffer_mapped_p(VALUE self)
{
struct rb_io_buffer_view *buffer = get_io_buffer_view(self);
return RBOOL(buffer->flags & RB_IO_BUFFER_MAPPED);
}
If the buffer is mapped, meaning it references memory mapped by the buffer.
Mapped buffers are either anonymous, if created by ::new with the IO::Buffer::MAPPED flag or if the size was at least IO::Buffer::PAGE_SIZE, or backed by a file if created with ::map.
Mapped buffers can usually be resized. Slices remain valid if their ranges still fit within the resized buffer, including when its mapping is moved.