@@ -58,7 +58,7 @@ impl ReusePool {
5858 // We don't remember stack addresses: there's a lot of them (so the perf impact is big),
5959 // and we only want to reuse stack slots within the same thread or else we'll add a lot of
6060 // undesired synchronization.
61- if kind == MemoryKind :: Stack || !rng. gen_bool ( self . address_reuse_rate ) {
61+ if kind == MemoryKind :: Stack || !rng. random_bool ( self . address_reuse_rate ) {
6262 return ;
6363 }
6464 let clock = clock ( ) ;
@@ -88,10 +88,10 @@ impl ReusePool {
8888 thread : ThreadId ,
8989 ) -> Option < ( u64 , Option < VClock > ) > {
9090 // Determine whether we'll even attempt a reuse. As above, we don't do reuse for stack addresses.
91- if kind == MemoryKind :: Stack || !rng. gen_bool ( self . address_reuse_rate ) {
91+ if kind == MemoryKind :: Stack || !rng. random_bool ( self . address_reuse_rate ) {
9292 return None ;
9393 }
94- let cross_thread_reuse = rng. gen_bool ( self . address_reuse_cross_thread_rate ) ;
94+ let cross_thread_reuse = rng. random_bool ( self . address_reuse_cross_thread_rate ) ;
9595 // Determine the pool to take this from.
9696 let subpool = self . subpool ( align) ;
9797 // Let's see if we can find something of the right size. We want to find the full range of
@@ -118,7 +118,7 @@ impl ReusePool {
118118 return None ;
119119 }
120120 // Pick a random element with the desired size.
121- let idx = rng. gen_range ( begin..end) ;
121+ let idx = rng. random_range ( begin..end) ;
122122 // Remove it from the pool and return.
123123 let ( chosen_addr, chosen_size, chosen_thread, clock) = subpool. remove ( idx) ;
124124 debug_assert ! ( chosen_size >= size && chosen_addr % align. bytes( ) == 0 ) ;
0 commit comments