use ULL2NUM directly.
@nobu pointed out that ULL (unsigned long long) should have at least 64 bits so ULL2NUM(uint64_t) is not problem.
This commit is contained in:
parent
c347038d4e
commit
6c64013978
Notes:
git
2021-11-19 08:32:29 +09:00
12
gc.rb
12
gc.rb
@ -292,23 +292,13 @@ module GC
|
|||||||
}
|
}
|
||||||
end
|
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:
|
# call-seq:
|
||||||
# GC.total_time -> int
|
# GC.total_time -> int
|
||||||
#
|
#
|
||||||
# Return measured GC total time in nano seconds.
|
# Return measured GC total time in nano seconds.
|
||||||
def self.total_time
|
def self.total_time
|
||||||
Primitive.cexpr! %{
|
Primitive.cexpr! %{
|
||||||
UINT64_2NUM(rb_objspace.profile.total_time_ns)
|
ULL2NUM(rb_objspace.profile.total_time_ns)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user