When calculating allowance, don't blindly cast from double to uint as it might not...
commit5f3262530107cc5a86a840e7c9466e13b2d3c792
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 17 Jul 2012 16:23:03 +0000 (17 13:23 -0300)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 17 Jul 2012 17:06:27 +0000 (17 14:06 -0300)
tree80540f60f31f9a6c732e9ec3f6dff94e8d8b8090
parent8f5b1a045449ea6677cadafe554880caf669f133
When calculating allowance, don't blindly cast from double to uint as it might not saturate the result.

* sgen-gc.c (try_calculate_minor_collection_allowance): For workloads with very high
survival rates the calculated allowance_target can overflow a mword on 32bits systems.
Given this behavior is unspecified and we've been bitten by it, let's take the safe
side and manually saturate it.
mono/metadata/sgen-gc.c
mono/metadata/sgen-gc.h