diff options
author | Yusuke Endoh <[email protected]> | 2021-11-19 10:09:51 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2021-11-19 10:09:51 +0900 |
commit | 4b1dd75e6c4308801156b4839662868be8676ff0 (patch) | |
tree | e4767f2757903357436662f70c5f8cbf2c79805c /gc.c | |
parent | 82ea2870188d66aa75a99f03b4e7fdd1750aa196 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |