When heap allocating memory in Rust code compiled to Wasm, memory in a Wasm linear memory is allocated.
Do I understand correctly that the value of the pointer is the offset in that memory? If yes, is it possible and valid to get the value 0
as offset/pointer?
A simple example would be:
let data: Vec<u8> = Vec::with_capacity(123);
let data_ptr = data.as_ptr() as usize;
Can I assume data_ptr
is non-zero or would that be a valid address?