@@ -634,10 +634,10 @@ static inline mi_block_t* mi_block_nextx( const void* null, const mi_block_t* bl
634634  mi_track_mem_defined (block,sizeof (mi_block_t ));
635635  mi_block_t * next;
636636  #ifdef  MI_ENCODE_FREELIST
637-   next = (mi_block_t *)mi_ptr_decode (null, block->next , keys);
637+   next = (mi_block_t *)mi_ptr_decode (null, mi_atomic_load_relaxed (& block->next ) , keys);
638638  #else 
639639  MI_UNUSED (keys); MI_UNUSED (null);
640-   next = (mi_block_t *)block->next ;
640+   next = (mi_block_t *)mi_atomic_load_relaxed (& block->next ) ;
641641  #endif 
642642  mi_track_mem_noaccess (block,sizeof (mi_block_t ));
643643  return  next;
@@ -646,10 +646,10 @@ static inline mi_block_t* mi_block_nextx( const void* null, const mi_block_t* bl
646646static  inline  void  mi_block_set_nextx (const  void * null, mi_block_t * block, const  mi_block_t * next, const  uintptr_t * keys) {
647647  mi_track_mem_undefined (block,sizeof (mi_block_t ));
648648  #ifdef  MI_ENCODE_FREELIST
649-   block->next  =  mi_ptr_encode (null, next, keys);
649+   mi_atomic_store_relaxed (& block->next ,  mi_ptr_encode (null, next, keys) );
650650  #else 
651651  MI_UNUSED (keys); MI_UNUSED (null);
652-   block->next  =  (mi_encoded_t )next;
652+   mi_atomic_store_relaxed (& block->next ,  (mi_encoded_t )next) ;
653653  #endif 
654654  mi_track_mem_noaccess (block,sizeof (mi_block_t ));
655655}
0 commit comments