From 50ca22510c2a64c11628f5c89eac5dd47ebc9f5f Mon Sep 17 00:00:00 2001 From: Xuanzhong Wei Date: Tue, 3 Oct 2017 23:57:18 +0900 Subject: fix GC issue on rb_global_variable array We need to add the array to ruby's global_list right after created it; otherwise it probably gets GCed. (cherry picked from commit e85de00a3065461f6fac466276d915b809f40c7c) --- ext/unicorn_http/unicorn_http.rl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); #ifndef HAVE_RB_HASH_CLEAR id_clear = rb_intern("clear"); -- cgit v1.2.3-24-ge0c7 From a14e8115d3450e716428fd3b77b6ede4d0da167e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 Oct 2017 18:56:05 +0000 Subject: unicorn 5.3.1 This release fixes an occasional GC problem introduced in v5.3.0 to reduce global variable overhead (commit 979ebcf91705709b) Thanks to Xuanzhong Wei for the patch which lead to this release: https://bogomips.org/unicorn-public/20171003182054.76392-1-azrlew@gmail.com/T/#u https://bogomips.org/unicorn-public/20171003145718.30404-1-azrlew@gmail.com/T/#u Xuanzhong Wei (1): fix GC issue on rb_global_variable array --- GIT-VERSION-GEN | 2 +- unicorn.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index a05e26a..0811c7f 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -DEF_VER = "v5.3.0" +DEF_VER = "v5.3.1" CONSTANT = "Unicorn::Const::UNICORN_VERSION" RVF = "lib/unicorn/version.rb" GVF = "GIT-VERSION-FILE" diff --git a/unicorn.gemspec b/unicorn.gemspec index 74483a2..2e104f7 100644 --- a/unicorn.gemspec +++ b/unicorn.gemspec @@ -11,7 +11,7 @@ end.compact Gem::Specification.new do |s| s.name = %q{unicorn} - s.version = (ENV['VERSION'] || '5.3.0').dup + s.version = (ENV['VERSION'] || '5.3.1').dup s.authors = ['unicorn hackers'] s.summary = 'Rack HTTP server for fast clients and Unix' s.description = File.read('README').split("\n\n")[1] -- cgit v1.2.3-24-ge0c7