File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 11use std:: mem:: transmute;
2- use std:: ptr:: read_unaligned;
32use std:: rc:: Rc ;
43use std:: str:: FromStr ;
54use monoteny_macro:: { pop_ip, un_expr, un_expr_try} ;
Original file line number Diff line number Diff line change 11use std:: alloc:: { alloc, Layout } ;
22use std:: intrinsics:: transmute;
3- use std:: ptr:: write_unaligned;
43use uuid:: Uuid ;
5- use crate :: program:: types:: TypeProto ;
64
75#[ derive( Copy , Clone ) ]
86pub union Value {
@@ -29,12 +27,12 @@ impl Value {
2927// TODO The constants should probably be alloced in the chunk's constants, not 'anywhere'.
3028pub unsafe fn string_to_ptr ( string : & String ) -> * mut ( ) {
3129 let data = alloc ( Layout :: new :: < String > ( ) ) ;
32- write_unaligned ( data as * mut String , string. clone ( ) ) ;
30+ * ( data as * mut String ) = string. clone ( ) ;
3331 transmute ( data)
3432}
3533
3634pub unsafe fn uuid_to_ptr ( uuid : Uuid ) -> * mut ( ) {
3735 let data = alloc ( Layout :: new :: < Uuid > ( ) ) ;
38- write_unaligned ( data as * mut Uuid , uuid) ;
36+ * ( data as * mut Uuid ) = uuid;
3937 transmute ( data)
4038}
Original file line number Diff line number Diff line change @@ -401,15 +401,15 @@ impl VM {
401401 let sp_last = sp. offset ( -8 ) ;
402402 let slot_ptr = ( * sp_last) . ptr . byte_add ( usize:: try_from ( slot_idx) . unwrap ( ) * 8 ) ;
403403
404- * sp_last = read_unaligned ( slot_ptr as * mut Value ) ;
404+ * sp_last = * ( slot_ptr as * mut Value ) ;
405405 }
406406 OpCode :: SET_MEMBER_32 => {
407407 let slot_idx = pop_ip ! ( u32 ) ;
408408 let value = pop_stack ( & mut sp) ;
409409 let obj_ptr = pop_stack ( & mut sp) . ptr ;
410410 let slot_ptr = obj_ptr. byte_add ( usize:: try_from ( slot_idx) . unwrap ( ) * 8 ) ;
411411
412- write_unaligned ( slot_ptr as * mut Value , value) ;
412+ * ( slot_ptr as * mut Value ) = value;
413413 }
414414 }
415415 }
You can’t perform that action at this time.
0 commit comments