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	[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

raindrops RubyGem user+dev discussion/patches/pulls/bugs/help

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhbt.net/raindrops-public
	git clone --mirror http://ou63pmih66umazou.onion/raindrops-public

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 raindrops-public raindrops-public/ https://yhbt.net/raindrops-public \
		raindrops-public@yhbt.net raindrops-public@bogomips.org raindrops@librelist.org raindrops@librelist.com
	public-inbox-index raindrops-public

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.raindrops
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	../../../raindrops.git

AGPL code for this site: git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git