organizing samples

This commit is contained in:
NikVolf
2017-04-25 11:02:29 +03:00
parent 115df22213
commit 7d83551276
3 changed files with 0 additions and 28 deletions
-10
View File
@@ -1,10 +0,0 @@
int ops = 0;
void log(int block_ops) {
ops += block_ops;
}
int call(int x) {
log(5);
return 2 * x;
}
-18
View File
@@ -1,18 +0,0 @@
#![feature(link_args)]
#![feature(drop_types_in_const)]
#![no_main]
#[link_args = "-s WASM=1 -s NO_EXIT_RUNTIME=1 -s NO_FILESYSTEM=1"]
extern {}
static mut DATA: Option<Vec<u8>> = None;
#[no_mangle]
pub fn call() {
let mut vec = Vec::new();
unsafe { if let Some(ref v) = DATA { vec.extend(v); }; }
vec.push(1u8);
unsafe {
DATA = Some(vec);
}
}