Bug #14204 ยป 0001-socket-use-frozen-string-buffer-when-releasing-GVL.patch
ext/socket/ancdata.c | ||
---|---|---|
rb_io_t *fptr;
|
||
struct msghdr mh;
|
||
struct iovec iov;
|
||
VALUE tmp;
|
||
int controls_num;
|
||
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
|
||
VALUE controls_str = 0;
|
||
... | ... | |
#endif
|
||
StringValue(data);
|
||
tmp = rb_str_tmp_frozen_acquire(data);
|
||
if (!RB_TYPE_P(controls, T_ARRAY)) {
|
||
controls = rb_ary_new();
|
||
... | ... | |
}
|
||
mh.msg_iovlen = 1;
|
||
mh.msg_iov = &iov;
|
||
iov.iov_base = RSTRING_PTR(data);
|
||
iov.iov_len = RSTRING_LEN(data);
|
||
iov.iov_base = RSTRING_PTR(tmp);
|
||
iov.iov_len = RSTRING_LEN(tmp);
|
||
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
|
||
if (controls_str) {
|
||
mh.msg_control = RSTRING_PTR(controls_str);
|
||
... | ... | |
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
|
||
RB_GC_GUARD(controls_str);
|
||
#endif
|
||
rb_str_tmp_frozen_release(data, tmp);
|
||
return SSIZET2NUM(ss);
|
||
}
|
internal.h | ||
---|---|---|
char *rb_str_fill_terminator(VALUE str, const int termlen);
|
||
void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen);
|
||
VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
|
||
VALUE rb_str_tmp_frozen_acquire(VALUE str);
|
||
void rb_str_tmp_frozen_release(VALUE str, VALUE tmp);
|
||
VALUE rb_str_chomp_string(VALUE str, VALUE chomp);
|
||
#ifdef RUBY_ENCODING_H
|
||
VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc);
|
||
... | ... | |
#endif
|
||
/* string.c (export) */
|
||
VALUE rb_str_tmp_frozen_acquire(VALUE str);
|
||
void rb_str_tmp_frozen_release(VALUE str, VALUE tmp);
|
||
#ifdef RUBY_ENCODING_H
|
||
/* internal use */
|
||
VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc);
|
||
-
|