diff options
author | Yuta Saito <[email protected]> | 2021-12-02 13:20:13 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2021-12-02 15:53:43 +0900 |
commit | 6721ce1cc4035fe5508c13d0151f748e8b8e8cf1 (patch) | |
tree | da53c746c87abfadd66811adf279743300f13397 /gc.c | |
parent | a7d0c2c4489f94a0087646040afccb66cec4e7d7 (diff) |
Cast tv_usec to int32_t to fit in tv_nsec
suseconds_t, which is the type of tv_usec, may be defined with a longer
size type than tv_nsec's type (long). So usec to nsec conversion needs
an explicit casting.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5200
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -12395,7 +12395,7 @@ current_process_time(struct timespec *ts) if (getrusage(RUSAGE_SELF, &usage) == 0) { time = usage.ru_utime; ts->tv_sec = time.tv_sec; - ts->tv_nsec = time.tv_usec * 1000; + ts->tv_nsec = (int32_t)time.tv_usec * 1000; return true; } } |