Skip to content

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

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.