[前][次][番号順一覧][スレッド一覧]

ruby-changes:58004

From: Nobuyoshi <ko1@a...>
Date: Sun, 29 Sep 2019 18:53:34 +0900 (JST)
Subject: [ruby-changes:58004] 94db8cda9b (master): [ruby/zlib] Fix for older ruby 2.6 or earlier

https://git.ruby-lang.org/ruby.git/commit/?id=94db8cda9b

From 94db8cda9b4eeee4736d089570a343fdf5ef86c0 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 29 Sep 2019 18:52:31 +0900
Subject: [ruby/zlib] Fix for older ruby 2.6 or earlier

https://github.com/ruby/zlib/commit/00ead8cb2c

diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 22b4d0f..3953a5b 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -27,6 +27,10 @@ https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L27
 
 #define RUBY_ZLIB_VERSION "1.0.0"
 
+#ifndef RB_PASS_CALLED_KEYWORDS
+# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
+#endif
+
 #ifndef GZIP_SUPPORT
 #define GZIP_SUPPORT  1
 #endif
@@ -1061,9 +1065,14 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L1065
     }
 
 loop:
+#ifndef RB_NOGVL_UBF_ASYNC_SAFE
+    err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)&args,
+						 zstream_unblock_func, (void *)&args);
+#else
     err = (int)(VALUE)rb_nogvl(zstream_run_func, (void *)&args,
                                zstream_unblock_func, (void *)&args,
                                RB_NOGVL_UBF_ASYNC_SAFE);
+#endif
 
     if (flush != Z_FINISH && err == Z_BUF_ERROR
 	    && z->stream.avail_out > 0) {
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]