Code segment unload: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(Added FreeBASIC) |
||
Line 21: | Line 21: | ||
The <code>CANCEL</code> statement in COBOL unloads from memory the dynamically-loadable module containing the specified program or entry-point. |
The <code>CANCEL</code> statement in COBOL unloads from memory the dynamically-loadable module containing the specified program or entry-point. |
||
<syntaxhighlight lang="cobol">CANCEL "foo"</syntaxhighlight> |
<syntaxhighlight lang="cobol">CANCEL "foo"</syntaxhighlight> |
||
=={{header|FreeBASIC}}== |
|||
In FreeBASIC, there is no direct way to unload an unused section of code from memory. However, you can free memory used by variables or data. |
|||
Here's an example of how you could do it: |
|||
<syntaxhighlight lang="vbnet">DIM AS INTEGER PTR p |
|||
p = CALLOC(100, SIZEOF(INTEGER)) ' Reserve memory for 100 integers |
|||
'Use memory... |
|||
DEALLOC(p) ' Free the memory |
|||
p = NULL ' Ensures that the pointer does not point to a freed memory location |
|||
</syntaxhighlight> |
|||
=={{header|Furor}}== |
=={{header|Furor}}== |