Nosica supports destruction of a variable as soon as it is no more used. That means that as soon as the last reference to a variable reach end of scope the destructor has to be called and the memory freed.
A classical garbage collector (incremental or copying or using the train algotithm or whatever) is always asynchronous and does not fit well in this semantic.
Therefore, Nosica uses a simple, synchronous, possibly not efficient but deterministic algorithm : a reference counted garbage collector.
pros :
- proper semantic for destructor
- synchronous
- deterministic (no interruption of the program for several seconds)
cons :
- may be inefficient (we will have to optimise the reference counting)
- cyclic references are not destroyed
No comments yet