Skip to content

Commit 573e70c

Browse files
authored
Merge pull request #56 from rustwasm/no-llvm-intrinsic
No llvm intrinsic
2 parents dd07a78 + 7e22adb commit 573e70c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ env:
1313
before_script:
1414
- rustup target add wasm32-unknown-unknown
1515
- rustup target add i686-pc-windows-gnu
16-
- which wasm-gc || cargo install --git https://github.com/alexcrichton/wasm-gc
17-
- which cargo-readme || cargo install cargo-readme
16+
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
17+
- (test -x $HOME/.cargo/bin/cargo-readme || cargo install --vers "^3" cargo-readme)
18+
- (test -x $HOME/.cargo/bin/wasm-gc || cargo install --vers "^0.1.6" wasm-gc)
19+
- cargo install-update -a
1820

1921
script:
2022
- "$SCRIPT"

wee_alloc/src/imp_wasm32.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
use super::{assert_is_word_aligned, PAGE_SIZE, unchecked_unwrap};
22
use const_init::ConstInit;
33
use core::alloc::AllocErr;
4+
use core::arch::wasm32;
45
use core::cell::UnsafeCell;
56
use core::ptr::NonNull;
67
use memory_units::Pages;
78

8-
extern "C" {
9-
#[link_name = "llvm.wasm.grow.memory.i32"]
10-
fn grow_memory(pages: usize) -> i32;
11-
}
12-
139
pub(crate) unsafe fn alloc_pages(n: Pages) -> Result<NonNull<u8>, AllocErr> {
14-
let ptr = grow_memory(n.0);
10+
let ptr = wasm32::grow_memory(n.0 as i32);
1511
if -1 != ptr {
1612
let ptr = (ptr as usize * PAGE_SIZE.0) as *mut u8;
1713
assert_is_word_aligned(ptr as *mut u8);

wee_alloc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ for hacking!
226226
#![deny(missing_docs)]
227227
#![cfg_attr(not(feature = "use_std_for_test_debugging"), no_std)]
228228
#![feature(alloc, allocator_api, core_intrinsics)]
229-
#![cfg_attr(target_arch = "wasm32", feature(link_llvm_intrinsics))]
229+
#![cfg_attr(target_arch = "wasm32", feature(stdsimd))]
230230

231231
#[macro_use]
232232
extern crate cfg_if;

0 commit comments

Comments
 (0)