Skip to main content

object_push_to_stack

Function object_push_to_stack 

Source
pub fn object_push_to_stack(object: Object, data_stack: &mut DataStack) -> bool
Expand description

Moves an object onto the stack as a plain value of its type.

The object’s own allocation is freed, since the stack takes the bytes. Returns false when the value does not fit.

Native types only. A stack slot keeps its destructor as a plain function pointer. A runtime type drops itself by a field walk, which is not a function pointer. Such a value would be dropped without its fields, and every allocation they own would leak, so this refuses instead. Put a runtime value in a DynamicManaged and push that.