Memory allocation: Difference between revisions
Content added Content deleted
m (→{{header|Retro}}: update for retro12) |
|||
Line 1,261: | Line 1,261: | ||
=={{header|Retro}}== |
=={{header|Retro}}== |
||
Retro's memory is directly accessible via ''' |
Retro's memory is directly accessible via '''fetch''' and '''store'''. This is used for all functions and data structures. A variable, '''Heap''', points to the next free address. '''allot''' can be used to allocate or free memory. The amount of memory varies by the runtime, and can be accessed via the '''EOM''' constant. |
||
<lang Retro> |
<lang Retro>display total memory available |
||
@memory putn |
|||
~~~ |
|||
( display unused memory ) |
|||
EOM n:put |
|||
@memory here - putn |
|||
~~~ |
|||
display unused memory |
|||
⚫ | |||
~~~ |
|||
⚫ | |||
EOM here - n:put |
|||
⚫ | |||
~~~ |
|||
display next free address |
|||
⚫ | |||
~~~ |
|||
⚫ | |||
~~~ |
|||
⚫ | |||
~~~ |
|||
⚫ | |||
~~~ |
|||
free 500 cells |
|||
~~~ |
|||
⚫ | |||
~~~</lang> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |