[][src]Module cosmwasm::memory

Structs

Slice

Slice refers to some heap allocated data in wasm. A pointer to this can be returned over ffi boundaries.

Functions

alloc

alloc is the same as external allocate, but designed to be called internally

build_slice

build_slice returns a box of a slice, which can be sent over a call to extern note that this DOES NOT take ownership of the data, and we MUST NOT consume_slice the resulting data. The Box must be dropped (with scope), but not the data

consume_slice

consume_slice will return the data referenced by the slice and deallocates the slice (and the vector when finished). Warning: only use this when you are sure the caller will never use (or free) the slice later

release_buffer

release_buffer is like alloc, but instead of creating a new vector it consumes an existing one and returns a pointer to the slice (preventing the memory from being freed until explicitly called later)