@@ -80,11 +80,9 @@ fn sync_get_data<'tcx, T: 'static + Copy>(
8080 // If it is initialized, it must be found in the "sync primitive" table,
8181 // or else it has been moved illegally.
8282 let ( alloc, offset, _) = ecx. ptr_get_alloc_id ( primitive. ptr ( ) , 0 ) ?;
83- let ( alloc_extra, _machine ) = ecx. get_alloc_extra_mut ( alloc) ?;
83+ let alloc_extra = ecx. get_alloc_extra ( alloc) ?;
8484 let data = alloc_extra
85- . sync
86- . get ( & offset)
87- . and_then ( |s| s. downcast_ref :: < T > ( ) )
85+ . get_sync :: < T > ( offset)
8886 . ok_or_else ( || err_ub_format ! ( "`{name}` can't be moved after first use" ) ) ?;
8987 interp_ok ( Some ( * data) )
9088 } else {
@@ -174,7 +172,7 @@ enum MutexKind {
174172
175173#[ derive( Debug , Clone , Copy ) ]
176174/// Additional data that we attach with each mutex instance.
177- pub struct MutexData {
175+ struct MutexData {
178176 id : MutexId ,
179177 kind : MutexKind ,
180178}
@@ -228,7 +226,7 @@ fn mutex_create<'tcx>(
228226 kind : MutexKind ,
229227) -> InterpResult < ' tcx , MutexData > {
230228 let mutex = ecx. deref_pointer ( mutex_ptr) ?;
231- let id = ecx. mutex_create ( ) ;
229+ let id = ecx. machine . sync . mutex_create ( ) ;
232230 let data = MutexData { id, kind } ;
233231 sync_init ( ecx, & mutex, mutex_init_offset ( ecx) ?, data) ?;
234232 interp_ok ( data)
@@ -290,7 +288,7 @@ fn mutex_kind_from_static_initializer<'tcx>(
290288
291289#[ derive( Debug , Copy , Clone ) ]
292290/// Additional data that we attach with each rwlock instance.
293- pub struct RwLockData {
291+ struct RwLockData {
294292 id : RwLockId ,
295293}
296294
@@ -337,7 +335,7 @@ fn rwlock_get_data<'tcx>(
337335 ) ? {
338336 throw_unsup_format ! ( "unsupported static initializer used for `pthread_rwlock_t`" ) ;
339337 }
340- let id = ecx. rwlock_create ( ) ;
338+ let id = ecx. machine . sync . rwlock_create ( ) ;
341339 let data = RwLockData { id } ;
342340 sync_init ( ecx, & rwlock, init_offset, data) ?;
343341 interp_ok ( data)
@@ -446,7 +444,7 @@ fn cond_create<'tcx>(
446444 clock : ClockId ,
447445) -> InterpResult < ' tcx , CondData > {
448446 let cond = ecx. deref_pointer ( cond_ptr) ?;
449- let id = ecx. condvar_create ( ) ;
447+ let id = ecx. machine . sync . condvar_create ( ) ;
450448 let data = CondData { id, clock } ;
451449 sync_init ( ecx, & cond, cond_init_offset ( ecx) ?, data) ?;
452450 interp_ok ( data)
0 commit comments