Wasm32Sized for isize

This commit is contained in:
Folkert 2022-07-27 20:10:47 +02:00
parent da74585786
commit 9bdf1f733f
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C

View File

@ -65,6 +65,11 @@ impl Wasm32Sized for usize {
const ALIGN_OF_WASM: usize = 4;
}
impl Wasm32Sized for isize {
const SIZE_OF_WASM: usize = 4;
const ALIGN_OF_WASM: usize = 4;
}
impl<T: Wasm32Sized, U: Wasm32Sized> Wasm32Sized for (T, U) {
const SIZE_OF_WASM: usize = T::SIZE_OF_WASM + U::SIZE_OF_WASM;
const ALIGN_OF_WASM: usize = max(&[T::ALIGN_OF_WASM, U::ALIGN_OF_WASM]);