kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Aaron Patterson <tenderlove@ruby-lang.org>,
	Ngan Pham <nganpham@gmail.com>
Cc: kgio-public@yhbt.net
Subject: Re: Patch for GC.compact memory issue
Date: Tue, 25 May 2021 22:50:37 +0000	[thread overview]
Message-ID: <20210525225037.GA3369@dcvr> (raw)
In-Reply-To: <CAPJJa7txP7D9s5AOLFxs_Kxuvq_Yx_5BBYMbafdn8LaGjb-yvA@mail.gmail.com>

Thanks all, pushed as 4db359156adb5aed102ec853f56c030ba40b1eca
with the commit message below.  Will release in a bit..

-----8<-----
From: Ngan Pham <nganpham@gmail.com>
Date: Mon, 24 May 2021 20:34:36 +0000
Subject: [PATCH] fix compatibility with GC.compact

Constants defined in Ruby need to be explicitly marked
when made static inside a C extension.

Link: https://yhbt.net/kgio-public/CAAvYYt5Z5f2rMuXO5DMpR1-6uRvu_gXKDvqcyoZ+oNcLiTH39g@mail.gmail.com/T/
Commit-message-by: Eric Wong <e@80x24.org>
---
 ext/kgio/accept.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ext/kgio/accept.c b/ext/kgio/accept.c
index f1de39d..4bd9cfe 100644
--- a/ext/kgio/accept.c
+++ b/ext/kgio/accept.c
@@ -498,9 +498,12 @@ void init_kgio_accept(void)
 	rb_define_const(mKgio, "SOCK_CLOEXEC", INT2NUM(SOCK_CLOEXEC));
 
 	localhost = rb_const_get(mKgio, rb_intern("LOCALHOST"));
+	rb_gc_register_mark_object(localhost);
 	cKgio_Socket = rb_const_get(mKgio, rb_intern("Socket"));
+	rb_gc_register_mark_object(cKgio_Socket);
 	cClientSocket = cKgio_Socket;
 	mSocketMethods = rb_const_get(mKgio, rb_intern("SocketMethods"));
+	rb_gc_register_mark_object(mSocketMethods);
 
 	rb_define_method(mSocketMethods, "kgio_addr!", addr_bang, 0);
 

      reply	other threads:[~2021-05-25 22:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 14:14 Patch for GC.compact memory issue Ngan Pham
2021-05-24 17:22 ` Eric Wong
2021-05-24 19:00   ` Ngan Pham
2021-05-24 20:33     ` Eric Wong
2021-05-24 21:11       ` Ngan Pham
2021-05-24 21:48         ` [PATCH] HACKING: update docs with "git request-pull" info Eric Wong
2021-05-25 16:41         ` Patch for GC.compact memory issue Aaron Patterson
2021-05-25 22:50           ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/kgio/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210525225037.GA3369@dcvr \
    --to=e@80x24.org \
    --cc=kgio-public@yhbt.net \
    --cc=nganpham@gmail.com \
    --cc=tenderlove@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

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