[$] Scope-based resource management for the kernel

Post Syndicated from original https://lwn.net/Articles/934679/

The C language does not provide the sort of resource-management features
found in more recent languages. As a result, bugs involving
leaked memory or failure to release a lock are relatively common in
programs written in C — including the kernel. The kernel project has never
limited itself to the language features found in the C standard, though;
kernel developers will happily
use extensions provided by compilers if they prove helpful. It looks like
a relatively simple compiler-provided feature may lead to a significant
change in some common kernel coding patterns.