Tests for native/wasm runtime

This commit is contained in:
Gav
2018-01-25 19:28:28 +01:00
parent 53eea2bed6
commit ead42293bc
15 changed files with 105 additions and 32 deletions
@@ -8,6 +8,7 @@ extern "C" {
fn ext_memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
fn ext_memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
fn ext_memset(dest: *mut u8, c: i32, n: usize) -> *mut u8;
fn ext_memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32;
fn ext_malloc(size: usize) -> *mut u8;
fn ext_free(ptr: *mut u8);
}
@@ -21,6 +22,12 @@ pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut
ext_memcpy(dest, src, n)
}
/// memcpy extern
#[no_mangle]
pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 {
ext_memcmp(s1, s2, n)
}
/// memmove extern
#[no_mangle]
pub unsafe extern "C" fn memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8 {