You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this allocator is intended to also work for wasm, but in my frontend I need speed more than size (it's a UI for a desktop application), so I thought I'd try it..
But it fails to build for wasm:
error[E0432]: unresolved imports `libc::c_void`, `libc::size_t`
--> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\libmimalloc-sys-0.1.9\src\lib.rs:3:12
|
3 | use libc::{c_void, size_t};
| ^^^^^^ ^^^^^^ no `size_t` in the root
| |
| no `c_void` in the root
error: could not compile `libmimalloc-sys`.
The text was updated successfully, but these errors were encountered:
@Boscop While the original mimalloc library compiles on WASM, the wrapper uses rust's libc to do ffi calls. Unfortunately, there is no WASM target available for libc. Check this out.
@octavonce Ah, right. It seems you're only using c_void and size_t from libc, right?
Could you please use the types from std::os::raw instead? Specifically c_void. (And size_t is always defined as usize, so you can use that.)
It's more idiomatic to not depend on libc unless it's really necessary, I also switched my ffi crates to use those types.
It would be sad if these types would prevent this allocator from building for wasm..
Not sure if this allocator is intended to also work for wasm, but in my frontend I need speed more than size (it's a UI for a desktop application), so I thought I'd try it..
But it fails to build for wasm:
The text was updated successfully, but these errors were encountered: