From: Eric Wong <e@80x24.org>
To: Xuanzhong Wei <azrlew@gmail.com>
Cc: unicorn-public@bogomips.org
Subject: Re: [PATCH] fix GC issue on rb_global_variable array
Date: Tue, 3 Oct 2017 17:47:52 +0000 [thread overview]
Message-ID: <20171003174752.GA30460@starla> (raw)
In-Reply-To: <20171003145718.30404-1-azrlew@gmail.com>
Xuanzhong Wei <azrlew@gmail.com> wrote:
> diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl
> index 6fc3498..357440b 100644
> --- a/ext/unicorn_http/unicorn_http.rl
> +++ b/ext/unicorn_http/unicorn_http.rl
> @@ -921,6 +921,7 @@ void Init_unicorn_http(void)
> VALUE mUnicorn, cHttpParser;
>
> mark_ary = rb_ary_new();
> + rb_global_variable(&mark_ary);
> mUnicorn = rb_define_module("Unicorn");
> cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject);
> eHttpParserError =
> @@ -976,7 +977,6 @@ void Init_unicorn_http(void)
> init_unicorn_httpdate(mark_ary);
>
> OBJ_FREEZE(mark_ary);
> - rb_global_variable(&mark_ary);
Yes, the compiler should be free to drop mark_ary by here, since
it only needs its address (not the actual VALUE) and OBJ_FREEZE
only accesses the RBasic->flags field if init_unicorn_httpdate
gets inlined.
Pushed to master as e85de00a3065461f6fac466276d915b809f40c7c.
Also, created a 5.3-stable branch for 5.3.1 (to be released today)
@ git://bogomips.org/unicorn
next prev parent reply other threads:[~2017-10-03 17:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 14:57 [PATCH] fix GC issue on rb_global_variable array Xuanzhong Wei
2017-10-03 17:47 ` Eric Wong [this message]
2017-10-03 18:26 ` Xuanzhong Wei
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/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171003174752.GA30460@starla \
--to=e@80x24.org \
--cc=azrlew@gmail.com \
--cc=unicorn-public@bogomips.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/unicorn.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).