ruby-changes:69817
From: Koichi <ko1@a...>
Date: Fri, 19 Nov 2021 08:32:24 +0900 (JST)
Subject: [ruby-changes:69817] 6c64013978 (master): use ULL2NUM directly.
https://git.ruby-lang.org/ruby.git/commit/?id=6c64013978 From 6c64013978e77637995a0348f7e232068b9f61b4 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Thu, 11 Nov 2021 23:00:42 +0900 Subject: use ULL2NUM directly. @nobu pointed out that ULL (unsigned long long) should have at least 64 bits so ULL2NUM(uint64_t) is not problem. --- gc.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/gc.rb b/gc.rb index d3f80dbaa8a..7a60710f66d 100644 --- a/gc.rb +++ b/gc.rb @@ -292,23 +292,13 @@ module GC https://github.com/ruby/ruby/blob/trunk/gc.rb#L292 } end - Primitive.cinit! %{ - #if SIZEOF_LONG == 8 - #define UINT64_2NUM RB_ULONG2NUM - #elif SIZEOF_LONG_LONG == 8 - #define UINT64_2NUM RB_ULL2NUM - #else - #error Can not make UINT64_2NUM - #endif - } - # call-seq: # GC.total_time -> int # # Return measured GC total time in nano seconds. def self.total_time Primitive.cexpr! %{ - UINT64_2NUM(rb_objspace.profile.total_time_ns) + ULL2NUM(rb_objspace.profile.total_time_ns) } end end -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/