Swift does away with pointers == pervasive ARC

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 17 01:18:59 PDT 2014


On 6/16/2014 10:02 PM, Manu via Digitalmars-d wrote:
> Granted. I don't really understand the situation well enough to
> comment with any authority. What are the conditions that create the
> requirement, or could relax it?

inc
try {
    ... code that may throw an exception ...
}
finally {
    dec;
}


> nothrow obviously relaxes this requirement.

Yes, it does.


> I don't know enough about other circumstances, but I can see a few
> possibilities. Also, just the frequency of pointer copying I see in my
> own code is very low, and I would NEVER generate that code in hot
> loops.
> I find it very hard to convince myself either way without evidence :/

I suggest writing some C++ code with shared_ptr<T>, and disassemble the result.


> I can't imagine exceptions would appear in hot code very often/ever?

I've tried to explain this to you for months. You don't believe my explanations, 
we just go round in circles. I strongly suggest you write some code with 
shared_ptr<T> and try it out. Disassemble the result. Benchmark it. Use 
Microsoft C++, so I won't be sabotaging your results and it won't be because I 
write crappy compilers :-)



More information about the Digitalmars-d mailing list