Memory allocation: Difference between revisions

m
→‎{{header|REXX}}: added comment about a non-error. -- ~~~~
(→‎{{header|REXX}}: added another comment about un-allocation of variables at PROCedure termination. -- ~~~~)
m (→‎{{header|REXX}}: added comment about a non-error. -- ~~~~)
Line 744:
 
=={{header|REXX}}==
There is no explicit memory allocation in REXX, variables are just assigned.
<br>Most REXXes will obtain a chunk of free storage, and then allocate storage out of that pool if possible, if not, obtain more storage.
assigned.
 
<lang rexx>Axtec_god.3='Quetzalcoatl ("feathered serpent"), god of learning, civilization, regeneration, wind and storms'</lang>
Line 751:
There is no explicit way to de-allocate memory, but there is a DROP statement that "un-defines" a REXX variable and it's memory is then free to be used for other variables, provided that free memory isn't too fragmented.
 
<lang rexx>drop xyz NamesRoster j k m caves names.</lang> Axtec_god. Hopi
 
/* it's not considered an error to DROP a variable that isn't defined.*/</lang>
 
Any variables (that are non-exposed) which are defined (allocated) in a procedure/subroutine/function will be un-allocated at the termination of the procedure/subroutine/function.