Re: [PATCH] cleanup: clarify scope-based resource management and goto guidance
From: Przemek Kitszel
Date: Thu Nov 26 2026 - 09:21:23 EST
On 11/26/26 10:50 AM, Peter Zijlstra wrote:
On Thu, Nov 26, 2026 at 05:29:33AM +0100, Przemek Kitszel wrote:
Then undo_pre_bar() is inside guard(); and that is very much not the
intention. The same will be true with ACQUIRE();
ah, I see :(
would it be fine to relax the doc and stop discouraging against
scoped_guard() and goto in the same function (but keep the "don't jump
into/out of its scope")?
So I don't really understand the problem we're trying to solve here. Is
this really about AI being stupid? Just wait a few months, I'll catch up
or something.
AI is smart enough to follow our (human) written instructions, and right
now, those discourage scoped_guard() mixed with goto.
I would like to reword to fix that :)
Of course it will also be good for those of us who read docs, and also
have the additional benefit of not popping up scoped_guard() usage
(I don't believe, but there are still maintainers that prefer old style
locks ;P)