3 ms·
> To acquire locks in a loop and release them at the end of a function. that looks like a super big gotcha, hasn't there been enough bugs with alloca() being
by jcelerier 5y ago
> To acquire locks in a loop and release them at the end of a function.
that looks like a super big gotcha, hasn't there been enough bugs with alloca() being called in a loop yet to show how risky and unintuitive this is ? block-scoped is explicit and explicit is good
- kaba0 5y agoGood implementations of defer are scope-based, so those would be clean up at the end of the loop pretty explicitly.