Code segment unload: Difference between revisions
m
syntax highlighting fixup automation
Puppydrum64 (talk | contribs) m (omit from assembly) |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 8:
=={{header|BASIC}}==
Some versions of basic have the facility to delete lines of code:
<
20 DELETE 5000-9999: REM delete initializer
30 PRINT A: REM show initializer worked
Line 16:
5000 REM this is a dummy initializer
5010 LET A=1
5020 RETURN</
=={{header|COBOL}}==
The <code>CANCEL</code> statement in COBOL unloads from memory the dynamically-loadable module containing the specified program or entry-point.
<
=={{header|Furor}}==
The <code>neglect</code> statement in Furor deletes from memory the named function. It is possible because each function is loaded into a dinamycally allocated memory segment.
<syntaxhighlight lang
=={{header|Go}}==
Line 32:
=={{header|Io}}==
<
block(
Line 42:
writeln("Doing real work.")
// Code to do the real work here.</
{{output}}
Line 113:
;Releasing commands
:The memory associated with a particular command can be released back to the general memory pool by deleting the command. This is done by either creating a new command with the same name, or by using <code>rename</code> to change the command's name to the empty string.
:<
;Releasing loaded extensions
:The memory associated with a loaded extension can be released by using <code>unload</code>, provided the extension has registered a handler function (this is relatively uncommon). Once the handler function has run (which gives the extension an opportunity to destroy any commands and other callbacks it has created), the underlying library will be removed from memory with <code>dlclose()</code> (on Unix) or <code>FreeLibrary()</code> (on Windows). This ''completely'' removes the program code concerned, as well as returning the other ancillary memory to the general pool.
:<syntaxhighlight lang
;Releasing an entire interpreter
:Provided an interpreter is not the ''root'' interpreter in its thread, you can delete it from an ancestor interpreter, which releases all the memory associated with it back into the general memory pool.
:<syntaxhighlight lang
=={{header|Wren}}==
|