]>
git.proxmox.com Git - rustc.git/blob - src/stdsimd/coresimd/wasm32.rs
2 #[link_name = "llvm.wasm.grow.memory.i32"]
3 fn llvm_grow_memory(pages
: i32) -> i32;
4 #[link_name = "llvm.wasm.current.memory.i32"]
5 fn llvm_current_memory() -> i32;
8 /// Corresponding intrinsic to wasm's [`current_memory` instruction][instr]
10 /// This function, when called, will return the current memory size in units of
13 /// [instr]: https://github.com/WebAssembly/design/blob/master/Semantics.md#resizing
15 pub unsafe fn current_memory() -> i32 {
19 /// Corresponding intrinsic to wasm's [`grow_memory` instruction][instr]
21 /// This function, when called, will attempt to grow the default linear memory
22 /// by the specified number of pages. If memory is successfully grown then the
23 /// previous size of memory, in pages, is returned. If memory cannot be grown
24 /// then -1 is returned.
26 /// [instr]: https://github.com/WebAssembly/design/blob/master/Semantics.md#resizing
28 pub unsafe fn grow_memory(delta
: i32) -> i32 {
29 llvm_grow_memory(delta
)