mirror of
https://github.com/extism/extism.git
synced 2026-01-12 23:38:04 -05:00
22 lines
359 B
Rust
22 lines
359 B
Rust
#![no_main]
|
|
#![no_std]
|
|
use extism_runtime_kernel::*;
|
|
use owi::*;
|
|
|
|
main!({
|
|
let n = alloc(1024);
|
|
|
|
let x = u64();
|
|
assume(x > 0);
|
|
|
|
let m = alloc(x);
|
|
|
|
// 1. Length should equal `x` while active
|
|
assert(length(m) == x);
|
|
|
|
// 2. Length should equal `0` after free
|
|
free(m); // Free the block
|
|
assert(length(m) == 0);
|
|
free(n);
|
|
});
|