Code segment unload: Difference between revisions

Content added Content deleted
(omit Go, any sane modern OS takes care of this)
(PARI and gp)
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.
<lang cobol>CANCEL "foo"</lang>
<lang cobol>CANCEL "foo"</lang>

=={{header|PARI/GP}}==

PARI code can be unloaded like any other C code. But if the code is in the form of a closure (i.e., a <code>GEN</code> object of type <code>t_CLOSURE</code>) then its space should be reclaimed by <code>gerepile</code> or moving <code>ltop</code> if it's at the bottom of the stack.

This is simpler in gp -- just <code>kill</code> the function (or set it to 0, not quite the same but will also cause the memory to be collected).


=={{header|Racket}}==
=={{header|Racket}}==