raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH] mark ListenStats in C ext for GC.compact
@ 2021-05-25 22:22 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-05-25 22:22 UTC (permalink / raw)
  To: raindrops-public

With GC.compact in Ruby 3.x, Ruby-defined constants need to be
explicitly marked to prevent movement.

Link: https://yhbt.net/kgio-public/CAAvYYt5Z5f2rMuXO5DMpR1-6uRvu_gXKDvqcyoZ+oNcLiTH39g@mail.gmail.com/T/
 ext/raindrops/linux_inet_diag.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c
index 60c80f1..cabd427 100644
--- a/ext/raindrops/linux_inet_diag.c
+++ b/ext/raindrops/linux_inet_diag.c
@@ -696,6 +696,7 @@ void Init_raindrops_linux_inet_diag(void)
 	rb_define_singleton_method(cIDSock, "new", ids_s_new, 0);
 	cListenStats = rb_const_get(cRaindrops, rb_intern("ListenStats"));
+	rb_gc_register_mark_object(cListenStats); /* pin */
 	rb_define_module_function(mLinux, "tcp_listener_stats",
 	                          tcp_listener_stats, -1);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-25 22:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 22:22 [PATCH] mark ListenStats in C ext for GC.compact Eric Wong

Code repositories for project(s) associated with this public inbox


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).