Skip to content

Commit

Permalink
TIL(rust): const generic can be used as function argument 😲
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSensor committed Sep 9, 2023
1 parent d8b5ef7 commit 8156d21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/wasm/instance/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ unsafe fn array_of(ty: Type, len: u16, nullable: bool) -> (Number, Null) {

let len_byte = len as usize * byte as usize; // shift offset for the next allocation
offset::set(addr + len_byte);
if offset::get() > memory_size::<0>() * PAGE {
if offset::get() > memory_size(0) * PAGE {
memory_grow(0, 1);
};

Expand Down

0 comments on commit 8156d21

Please sign in to comment.