diff options
author | Eric Wong <e@80x24.org> | 2018-12-26 04:51:31 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-12-26 04:51:31 +0000 |
commit | 2a6cb76d5010cb763ef5a2c305728465d15eb7c9 (patch) | |
tree | 1dd98b7239f194e0db3102a0f05aacc1707a4f2c /ext/unicorn_http/httpdate.c | |
parent | 2977d2c6dbb82fb62f2b6ba44687e44a554e2573 (diff) | |
download | unicorn-2a6cb76d5010cb763ef5a2c305728465d15eb7c9.tar.gz |
Since Ruby 2.6, it's a documented part of the API and we may depend on it: https://bugs.ruby-lang.org/issues/9894 It's been around since the early Ruby 1.9 days, and reduces overhead compared to relying on rb_global_variable: https://bogomips.org/unicorn-public/20170301002854.29198-1-e@80x24.org/
Diffstat (limited to 'ext/unicorn_http/httpdate.c')
-rw-r--r-- | ext/unicorn_http/httpdate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/unicorn_http/httpdate.c b/ext/unicorn_http/httpdate.c index 2381cff..b59d038 100644 --- a/ext/unicorn_http/httpdate.c +++ b/ext/unicorn_http/httpdate.c @@ -64,13 +64,13 @@ static VALUE httpdate(VALUE self) return buf; } -void init_unicorn_httpdate(VALUE mark_ary) +void init_unicorn_httpdate(void) { VALUE mod = rb_define_module("Unicorn"); mod = rb_define_module_under(mod, "HttpResponse"); buf = rb_str_new(0, buf_capa - 1); - rb_ary_push(mark_ary, buf); + rb_gc_register_mark_object(buf); buf_ptr = RSTRING_PTR(buf); httpdate(Qnil); |