@@ -78,7 +78,7 @@ impl GlobalStateInner {
78
78
GlobalStateInner {
79
79
int_to_ptr_map : Vec :: default ( ) ,
80
80
base_addr : FxHashMap :: default ( ) ,
81
- reuse : ReusePool :: new ( ) ,
81
+ reuse : ReusePool :: new ( config . address_reuse_rate ) ,
82
82
exposed : FxHashSet :: default ( ) ,
83
83
next_base_addr : stack_addr,
84
84
provenance_mode : config. provenance_mode ,
@@ -142,7 +142,11 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
142
142
}
143
143
}
144
144
145
- fn addr_from_alloc_id ( & self , alloc_id : AllocId , _kind : MemoryKind ) -> InterpResult < ' tcx , u64 > {
145
+ fn addr_from_alloc_id (
146
+ & self ,
147
+ alloc_id : AllocId ,
148
+ memory_kind : MemoryKind ,
149
+ ) -> InterpResult < ' tcx , u64 > {
146
150
let ecx = self . eval_context_ref ( ) ;
147
151
let mut global_state = ecx. machine . alloc_addresses . borrow_mut ( ) ;
148
152
let global_state = & mut * global_state;
@@ -161,7 +165,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
161
165
162
166
// This allocation does not have a base address yet, pick or reuse one.
163
167
let base_addr = if let Some ( ( reuse_addr, clock) ) =
164
- global_state. reuse . take_addr ( & mut * rng, size, align)
168
+ global_state. reuse . take_addr ( & mut * rng, size, align, memory_kind )
165
169
{
166
170
if let Some ( data_race) = & ecx. machine . data_race {
167
171
data_race. validate_lock_acquire ( & clock, ecx. get_active_thread ( ) ) ;
@@ -334,7 +338,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
334
338
}
335
339
336
340
impl < ' mir , ' tcx > MiriMachine < ' mir , ' tcx > {
337
- pub fn free_alloc_id ( & mut self , dead_id : AllocId , size : Size , align : Align ) {
341
+ pub fn free_alloc_id ( & mut self , dead_id : AllocId , size : Size , align : Align , kind : MemoryKind ) {
338
342
let global_state = self . alloc_addresses . get_mut ( ) ;
339
343
let rng = self . rng . get_mut ( ) ;
340
344
@@ -359,7 +363,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
359
363
// `alloc_id_from_addr` any more.
360
364
global_state. exposed . remove ( & dead_id) ;
361
365
// Also remember this address for future reuse.
362
- global_state. reuse . add_addr ( rng, addr, size, align, || {
366
+ global_state. reuse . add_addr ( rng, addr, size, align, kind , || {
363
367
let mut clock = concurrency:: VClock :: default ( ) ;
364
368
if let Some ( data_race) = & self . data_race {
365
369
data_race. validate_lock_release (
0 commit comments