Mac Apps That Use Garbage Collection Must Move to ARC

ponce via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 27 07:53:17 PST 2015


On Thursday, 26 February 2015 at 14:22:01 UTC, Ola Fosheim 
Grøstad wrote:
>> No. If I can't open a file I'd better not create a File object 
>> in an invalid state. Invalid states defeats RAII.
>
> This is the attitude I don't like, because it means that you 
> have to use pointers when you could just embed the file-handle. 
> That leads to more allocations and more cache misses.
>

I really don't understand how any of this is related to what we 
were previously discussing: error handling.


>> So you can't re-enter that mutex as you asked, so I will grant 
>> you a scopedLock, but it is in an errored state so you'd 
>> better check that it is valid!
>
> A file can always enter an errored state. So can OpenGL. That 
> doesn't mean you have to react immediately in all cases.
>

This is counter to my experience.
It does't make much sense to go on after an error, in any 
software that want some reliability.


More information about the Digitalmars-d mailing list