Migrate from @unaligned_load to mem::load

This commit is contained in:
Christoffer Lerno
2026-01-17 19:12:32 +01:00
parent a326e31e57
commit d3ebd4a130
9 changed files with 41 additions and 41 deletions

View File

@@ -101,7 +101,7 @@ macro read(bytes, $Type)
$default:
ptr = bytes[..].ptr;
$endswitch
return bitcast(@unaligned_load(*(char[$Type.sizeof]*)ptr, 1), $Type).val;
return bitcast(mem::load((char[$Type.sizeof]*)ptr, $align: 1), $Type).val;
}
<*
@@ -118,7 +118,7 @@ macro write(x, bytes, $Type)
$default:
ptr = bytes[..].ptr;
$endswitch
@unaligned_store(*($typeof(x)*)ptr, bitcast(x, $Type).val, 1);
mem::store(($typeof(x)*)ptr, bitcast(x, $Type).val, 1);
}
macro bool is_bitorder($Type)