top | item 45962595

(no title)

widdershins | 3 months ago

> With a reference counting GC, you're essentially emulating "perfect" use of C++ unique_ptr.

Did you mean shared_ptr? With unique_ptr there's no reference-counting overhead at all. When the reference count is atomic (as it must be in the general case), it can have a significant and measurable impact on performance.

discuss

order

netbioserror|3 months ago

You might be right. Though with the way I design software, I'm rarely passing managed objects via moves to unrelated scopes. So usually the scope that calls the destructor is my original initializing scope. It's a very functional, pyramidal program style.