Garbage collection of binaries

Jesper Wilhelmsson jesperw@REDACTED
Fri Oct 17 16:53:23 CEST 2003


On Fri, 17 Oct 2003, Joachim Durchholz wrote:

> Jesper Wilhelmsson wrote:
> > Binaries are referenced counted and are removed when their conter reach
> > zero.
>
> This gives me another approach: when you're done with a binary, zero out
> all references to it. The binary will go away immediately.

Well.. The only place where the reference count is decremented is in the
GC and when a process dies.
To manually decrement the reference count and promise the system to never
use the address again is not a verry functional way of doing things.
.joppe

>
> (This might be impossible if the reference is created as an intermediate
> result. It might also interfere with tail recursion. Using reference
> counts in a functional language doesn't strike me as a particularly good
> solution in this light...)
>
> Regards,
> Jo
>

    __
___(  |_______________________  _______________________________________________
    | | ,---. ,--.,--.,--.   ( (
    | ||  _  || o ) o ) p )   ) ) "Beware of bugs in the above code;
    | || (_) || r'| r'| -×--.( (  I have only proved it correct, not tried it."
o,--' | `---' |_| |_| `-----' ) )                               -- Donald Knuth
_`----'______________________( (_______________________________________________
Jesper Wilhelmsson, jesperw@REDACTED                         +46 (0)18 471 1046
Computing Science Department, Uppsala University, Sweden     +46 (0)733 207 207
-------------------------------------------------------------------------------




More information about the erlang-questions mailing list