[−][src]Module cosmwasm::memory
Structs
Region | 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_region | Returns a box of a Region, which can be sent over a call to extern note that this DOES NOT take ownership of the data, and we MUST NOT consume_region the resulting data. The Box must be dropped (with scope), but not the data |
consume_region⚠ | Return the data referenced by the Region and deallocates the Region (and the vector when finished). Warning: only use this when you are sure the caller will never use (or free) the Region 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 Region (preventing the memory from being freed until explicitly called later) |