[runtime] Fix potential overflow when using mono_msec_ticks
commit6277ba55de75c3a760ba030e112485a623c02d89
authorLudovic Henry <ludovic@xamarin.com>
Fri, 4 Mar 2016 11:37:38 +0000 (4 11:37 +0000)
committerLudovic Henry <ludovic@xamarin.com>
Thu, 17 Mar 2016 14:46:05 +0000 (17 14:46 +0000)
tree4aaf5d4b97717cd7b2b6c4488d0c2e8a21bddc96
parent12ff2e4514bfe403714b54a239765d12ad326dde
[runtime] Fix potential overflow when using mono_msec_ticks

Because mono_msec_ticks would previously return the number of milliseconds since boot time, it would overflow after ~49 days. That would mean that anywhere you would use it, you would need to be careful of arithmetic overflow.

By simply returning a gint64 we will not overflow before ~30k years.

Fixes bug https://bugzilla.xamarin.com/show_bug.cgi?id=38666
mono/io-layer/processes.c
mono/metadata/gc.c
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/monitor.c
mono/metadata/threadpool-ms.c
mono/metadata/threads.c
mono/mini/debugger-agent.c
mono/utils/mono-proclib.c
mono/utils/mono-time.c
mono/utils/mono-time.h