Memory allocation: Difference between revisions

Content added Content deleted
(Lingo added)
Line 715: Line 715:
=={{header|Lingo}}==
=={{header|Lingo}}==
Lingo does not allow direct memory allocation and has no direct access to memory types like heap, stack etc. But indirectly the ByteArray data type can be used to allocate memory that then later can be filled with custom data:
Lingo does not allow direct memory allocation and has no direct access to memory types like heap, stack etc. But indirectly the ByteArray data type can be used to allocate memory that then later can be filled with custom data:
<lang lingo>-- create a ByteArray of 100 Kb (pre-filled with 0 bytes)
<lang lingo>-- Create a ByteArray of 100 Kb (pre-filled with 0 bytes)
ba = byteArray(102400)</lang>
ba = byteArray(102400)

-- Lingo uses garbage-collection, so allocated memory is released when no more references exist.
-- For the above variable ba, this can be achieved by calling:
ba = VOID</lang>


=={{header|Maple}}==
=={{header|Maple}}==