Jump to content

Memory allocation: Difference between revisions

added Arturo implementation
m (→‎Heap: Fixed typo)
(added Arturo implementation)
Line 196:
% the memory allocated will now be garbage collected - there is no explicit de-allocation %
end.</syntaxhighlight>
 
=={{header|Arturo}}==
 
In Arturo, memory allocation is handled totally and exclusively by the VM, who is responsible for allocating and de-allocatiing memory when no longer needed, via the garbage collector.
 
The only way a programmer can "allocate" more memory is by flexible structures, like Blocks, and adding more elements to one of the pre-allocated structures.
 
<syntaxhighlight lang="arturo">
myBlock: @[1 2 3]
'myBlock ++ [4 5 6]
</syntaxhighlight>
 
=={{header|AutoHotkey}}==
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.