@@ -58,7 +58,7 @@ impl ReusePool {
58
58
// We don't remember stack addresses: there's a lot of them (so the perf impact is big),
59
59
// and we only want to reuse stack slots within the same thread or else we'll add a lot of
60
60
// 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 ) {
62
62
return ;
63
63
}
64
64
let clock = clock ( ) ;
@@ -88,10 +88,10 @@ impl ReusePool {
88
88
thread : ThreadId ,
89
89
) -> Option < ( u64 , Option < VClock > ) > {
90
90
// 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 ) {
92
92
return None ;
93
93
}
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 ) ;
95
95
// Determine the pool to take this from.
96
96
let subpool = self . subpool ( align) ;
97
97
// 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 {
118
118
return None ;
119
119
}
120
120
// Pick a random element with the desired size.
121
- let idx = rng. gen_range ( begin..end) ;
121
+ let idx = rng. random_range ( begin..end) ;
122
122
// Remove it from the pool and return.
123
123
let ( chosen_addr, chosen_size, chosen_thread, clock) = subpool. remove ( idx) ;
124
124
debug_assert ! ( chosen_size >= size && chosen_addr % align. bytes( ) == 0 ) ;
0 commit comments