use rb_gc_register_mark_object
commit2a6cb76d5010cb763ef5a2c305728465d15eb7c9
authorEric Wong <e@80x24.org>
Wed, 26 Dec 2018 04:51:31 +0000 (26 04:51 +0000)
committerEric Wong <e@80x24.org>
Wed, 26 Dec 2018 04:51:31 +0000 (26 04:51 +0000)
tree1dd98b7239f194e0db3102a0f05aacc1707a4f2c
parent2977d2c6dbb82fb62f2b6ba44687e44a554e2573
use rb_gc_register_mark_object

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/
ext/unicorn_http/common_field_optimization.h
ext/unicorn_http/global_variables.h
ext/unicorn_http/httpdate.c
ext/unicorn_http/unicorn_http.rl