mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
23 lines
389 B
Rust
23 lines
389 B
Rust
//! Issue #63562
|
|
|
|
#![crate_type = "cdylib"]
|
|
|
|
mod foo {
|
|
#[link(wasm_import_module = "sqlite")]
|
|
extern "C" {
|
|
pub fn allocate(size: usize) -> i32;
|
|
pub fn deallocate(ptr: i32, size: usize);
|
|
}
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn allocate() {
|
|
unsafe {
|
|
foo::allocate(1);
|
|
foo::deallocate(1, 2);
|
|
}
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn deallocate() {}
|