D
Dmitriy V'jukov
The HnxGC Libraray - an accurate, pauseless & deterministic garbage
collector for C++ application, is released at
http://hnxgc.harnixworld.com
Features include: [...]
Efficient - Even HnxGC provide deterministic reclamation feature
similiar to the one in regular reference counting algorithm, we remove
the cost of reference maintenance significantly. The cost of most-
frequently-used reference copying, such as passing references as
parameters or return values between function calls, are removed. More
advanced technique, such as GlobalMemoryFence, are used to eliminate
the memory ordering cost for a multi-processors platforms.
Overhead of 'passing references as parameters or return values between
function calls' is not related to multi-threaded reference counting.
It's forgery. One can easily eliminate those overheads. Just pass
smart pointers by constant reference, not by value:
void f(smart_ptr<t> const& obj) {...}
instead of:
void f(smart_ptr<t> obj) {...}
With smart pointers like boost::intrusive_ptr one can pass just plain
pointer:
void f(t* obj) {...}
And apply 'move semantics' (Andrei Alexandrescu's mojo, or c++0x
rvalue references '&&'). So as following just *transfers* ownership:
smart_ptr<t> obj = f();
The main question: how one can eliminate overheads of reference
counting in *other* situations, where reference counting is *really*
needed?
As I understand, HnxGC doesn't answer this question...
Dmitriy V'jukov