3 ms·
>It's essentially exceptions for C. This is frankly horrifying and I can't believe the C standards committee is entertaining this. I can because C already incl
by cycloptic 6y ago
>It's essentially exceptions for C. This is frankly horrifying and I can't believe the C standards committee is entertaining this.
I can because C already includes setjmp/longjmp as an exception mechanism that gets used in plenty of real code. The problem here is that those don't unwind the stack so they would break and cause memory leaks when using defer statements.
- jbboehr 6y agoIf you're already using setjmp/longjmp I would suspect you are also already using an arena or avoiding heap allocations, so I don't know if it would specifically be a problem for memory leaks with defer.