Updates to FFI spec: performGC
ger at tzi.de
Thu Sep 12 06:25:48 EDT 2002
Alastair Reid wrote:
> Region-based systems have the quite wonderful property that garbage is
> disposed of promptly - you don't have to wait for the next GC for the
> memory to be released. Which means that performGC becomes a nullop.
This is not entirely true. Firstly, some region-based systems could use stacks of some
sort, which might mean hanging onto something recognised as garbage until it is possible
to pop the stack. Secondly, the user may think that something is garbage at the time of
performGC, although the compiler is not yet able to prove that it is.
I agree with those who regard it as extremely undesirable to rely on the garbage-collection
algorithm to carry out important actions (like closing a window or a file), if it matters
at all when they happen. I think "performGC" should be seen more as something like
C's "register" storage attribute, which is a friendly hint to the compiler but nothing
Manuel's new wording (except for the typo "advices" instead of "advises") expresses this
perfectly, so there probably isn't much point in discussing this further.
More information about the FFI