unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
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
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

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 14:57 Xuanzhong Wei
2017-10-03 17:47 ` Eric Wong [this message]
2017-10-03 18:26   ` Xuanzhong Wei

Reply instructions:

You may reply publically 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:

  List information: https://bogomips.org/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 \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://bogomips.org/unicorn-public
	git clone --mirror http://ou63pmih66umazou.onion/unicorn-public

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox