manuallyDestroyVariable

manuallyDestroyVariable (value --)

Inputs

Outputs

manuallyDestroyVariable is a designated-storage destruction builtin. It destroys a value in existing storage. Storage release or storage reuse is a separate operation. For an In-place local or field, NAME or .NAME and @NAME or .@NAME all designate the same storage for manual destruction.

Behavior

Example

"String" use
"memory.mplMalloc" use

Tracer: {
  value: 0;
  INIT: [
    ("init\n") printList
    42 !value
  ];
  DIE: [
    ("die\n") printList
  ];
};

{} 0 {} [
  slot: Tracer storageSize mplMalloc @Tracer addressToReference;
  @slot manuallyInitVariable
  ("-- value -- " slot.value "\n") printList
  slot manuallyDestroyVariable
  0
] "main" exportFunction

Expected Output

init
-- value -- 42
die

See also