* [PATCH] ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
@ 2015-05-06 21:20 Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-05-06 21:20 UTC (permalink / raw)
To: spew
The control buffer may be used throughout the function, so
prevent the string from being lost to GC.
* ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
---
ext/socket/ancdata.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index f0dbb2b..b4196d5 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1711,6 +1711,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
discard_cmsg(cmh, msg_end, (flags & MSG_PEEK) != 0);
rb_ary_push(ret, ctl);
}
+ RB_GC_GUARD(ctl_str);
}
#endif
--
EW
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
@ 2015-05-06 21:22 Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-05-06 21:22 UTC (permalink / raw)
To: spew
The control buffer may be used throughout the function, so
prevent the string from being lost to GC.
* ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
---
ext/socket/ancdata.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index f0dbb2b..3eaed1c 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1711,6 +1711,7 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
discard_cmsg(cmh, msg_end, (flags & MSG_PEEK) != 0);
rb_ary_push(ret, ctl);
}
+ RB_GC_GUARD(ctl_str);
}
#endif
--
EW
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-06 21:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 21:22 [PATCH] ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard Eric Wong
-- strict thread matches above, loose matches on Subject: below --
2015-05-06 21:20 Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).