End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO::Buffer#valid?
valid? → true or false
io_buffer.c
View on GitHub ↗
static VALUE
rb_io_buffer_valid_p(VALUE self)
{
struct rb_io_buffer *data = NULL;
TypedData_Get_Struct(self, struct rb_io_buffer, &rb_io_buffer_type, data);
return RBOOL(io_buffer_validate(data));
}
Returns whether the buffer data is accessible.
A buffer becomes invalid if it is a slice of another buffer which has been freed.