about summary refs log tree commit diff
path: root/library/stdarch/examples/wasm.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-09-06 15:34:05 -0700
committerGitHub <noreply@github.com>2018-09-06 15:34:05 -0700
commitc1965d33a8b276a28d32b77a09b20ccb68bc993c (patch)
treefe07a7d8182f4f7a2ba1e13b2d80e2bf124c257b /library/stdarch/examples/wasm.rs
parentb1dad3e46e232a7eb0d8e2a7bc7ef8e20bd89d91 (diff)
downloadrust-c1965d33a8b276a28d32b77a09b20ccb68bc993c.tar.gz
rust-c1965d33a8b276a28d32b77a09b20ccb68bc993c.zip
Rename `wasm32` memory intrinsics (#560)
The official name of the memory intrinsics has changed to `memory.size` and
`memory.grow`, so let's reflect that with our naming as well! Additionally they
have an argument of which memory to operate on with LLVM and must always be zero
currently.
Diffstat (limited to 'library/stdarch/examples/wasm.rs')
-rw-r--r--library/stdarch/examples/wasm.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/stdarch/examples/wasm.rs b/library/stdarch/examples/wasm.rs
index c181664c8ed..39ea93a410a 100644
--- a/library/stdarch/examples/wasm.rs
+++ b/library/stdarch/examples/wasm.rs
@@ -20,7 +20,7 @@ pub unsafe extern "C" fn page_alloc() -> *mut u8 {
         return ret as *mut u8;
     }
 
-    let ret = grow_memory(1);
+    let ret = memory::grow(0, 1);
 
     // if we failed to allocate a page then return null
     if ret == -1 {
@@ -39,7 +39,7 @@ pub unsafe extern "C" fn page_free(page: *mut u8) {
 
 #[no_mangle]
 pub unsafe extern "C" fn memory_used() -> usize {
-    (page_size() * (current_memory() as u32)) as usize
+    (page_size() * (memory::size(0) as u32)) as usize
 }
 
 fn page_size() -> u32 {