From 32fefc5742d1646d63a119b281baefcac551dfec Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 May 2015 05:59:27 +0000 Subject: http: use rb_hash_clear in Ruby 2.0+ Calling the function directly avoids the overhead of Ruby method table lookup and global method cache. The only downside is this is now hidden from tracers and cannot be overridden from Ruby, but I doubt anybody cares about that. --- ext/unicorn_http/extconf.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/unicorn_http/extconf.rb') diff --git a/ext/unicorn_http/extconf.rb b/ext/unicorn_http/extconf.rb index 7a1b0cd..1da0282 100644 --- a/ext/unicorn_http/extconf.rb +++ b/ext/unicorn_http/extconf.rb @@ -5,6 +5,7 @@ have_macro("SIZEOF_OFF_T", "ruby.h") or check_sizeof("off_t", "sys/types.h") have_macro("SIZEOF_SIZE_T", "ruby.h") or check_sizeof("size_t", "sys/types.h") have_macro("SIZEOF_LONG", "ruby.h") or check_sizeof("long", "sys/types.h") have_func("rb_str_set_len", "ruby.h") +have_func("rb_hash_clear", "ruby.h") # Ruby 2.0+ have_func("gmtime_r", "time.h") create_makefile("unicorn_http") -- cgit v1.2.3-24-ge0c7