3 ms·
> Tearing down in the success case is a feature, not a bug! I guess it is if you are thinking of this as C++ RAII destructors, which is indeed one very useful
by haberman 11y ago
> Tearing down in the success case is a feature, not a bug!
I guess it is if you are thinking of this as C++ RAII destructors, which is indeed one very useful case.
It's not useful in some other cases. Like imagine that you are writing the C equivalent of a constructor. If you initialize half your members and then run out of memory, you want to uninitialize only the members you managed to initialize already. attribute((cleanup)) doesn't help with this case.
- loeg 11y agoout_error: dtor(self);