Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLSocket#string_new_capacity
string_new_capacity(p1)
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_ssl_string_new_capacity(VALUE self, VALUE len)
{
rb_len_t capa = NUM2LEN(len);
return rb_str_buf_new(capa >= 0 ? capa : 0);
}
TODO: This shouldn’t be necessary, but we do not want to use String.new(capacity: len) in sysread because it allocates Hash objects for the kwargs.