summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-11-19 10:09:51 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-11-19 10:09:51 +0900
commit4b1dd75e6c4308801156b4839662868be8676ff0 (patch)
treee4767f2757903357436662f70c5f8cbf2c79805c /gc.c
parent82ea2870188d66aa75a99f03b4e7fdd1750aa196 (diff)
gc.c: Fix a compile error on some crossbuilds
http://rubyci.s3.amazonaws.com/crossruby/crossruby-master-wasm32_emscripten/log/20211118T233311Z.log.html.gz#make ``` compiling gc.c gc.c:10629:47: error: implicit conversion loses integer precision: 'unsigned long long' to 'size_t' (aka 'unsigned long') [-Werror,-Wshorten-64-to-32] SET(time, objspace->profile.total_time_ns / (1000 * 1000) /* ns -> ms */); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gc.c:10624:9: note: expanded from macro 'SET' return attr; \ ~~~~~~ ^~~~ gc.c:10629:47: error: implicit conversion loses integer precision: 'unsigned long long' to 'unsigned long' [-Werror,-Wshorten-64-to-32] SET(time, objspace->profile.total_time_ns / (1000 * 1000) /* ns -> ms */); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gc.c:10626:68: note: expanded from macro 'SET' rb_hash_aset(hash, gc_stat_symbols[gc_stat_sym_##name], SIZET2NUM(attr)); ~~~~~~~~~ ^~~~ 2 errors generated. ```
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 0bb44d24ae..60387d2ab3 100644
--- a/gc.c
+++ b/gc.c
@@ -10626,7 +10626,7 @@ gc_stat_internal(VALUE hash_or_sym)
rb_hash_aset(hash, gc_stat_symbols[gc_stat_sym_##name], SIZET2NUM(attr));
SET(count, objspace->profile.count);
- SET(time, objspace->profile.total_time_ns / (1000 * 1000) /* ns -> ms */);
+ SET(time, (size_t) (objspace->profile.total_time_ns / (1000 * 1000) /* ns -> ms */)); // TODO: UINT64T2NUM
/* implementation dependent counters */
SET(heap_allocated_pages, heap_allocated_pages);