On 6/25/2013 2:47 PM, Steven Schveighoffer wrote:
> I'm not sure exactly what is required for ARC to guarantee proper memory management (whether it requires flow-analysis or not), but it seems to work quite well for Objective-C. I think it helps minimize the expensive release/retain calls when you can just say "oh, someone else will clean that up later", just like you can with a GC.
>
> It might be good for someone who knows the ARC eliding techniques that clang uses to explain how they work. We certainly shouldn't ignore those techniques.
>

Also remember that O-C doesn't guarantee memory safety, so they are freed from some of the constraints we operate under. They can say "don't do that", we can't.

C++ shared_ptr<> is memory safe as long as you don't escape a pointer - and no C++ compiler checks for that.

COM is also memory safe as long as you carefully follow the conventions - and again, no C++ compiler checks it.

Reply via email to