Scope-Based Resource Management Infrastructure Merged For Linux 6.5
Here comes a very exciting addition to the Linux 6.5 kernel: the initial infrastructure has landed for scope-based resource management.
Peter Zijlstra of Intel has been working on this scope-based resource management code and the initial infrastructure is ready for Linux 6.5. Developers now will be able to leverage this functionality and make use of it in various areas over the coming releases.
The scope-based resource management for the kernel is based around the new __cleanup() macro for the Linux kernel that wraps around the GCC and LLVM Clang "cleanup" attribute. The compiler "cleanup" attribute allows for defining a function to be called when a variable goes out-of-scope and the compiler will ensure that memory is properly freed to avoid memory leaks. This support has been worked on by Zijlstra as part of his kernel lock and pointer guards code.
This pull request merged today on the US Independence Day adds the scope-based resource management infrastructure. But it's left for future merge windows (or trying to still squeeze this week into Linux 6.5 albeit unlikely) for actually converting existing code to make use of this __cleanup() infrastructure.
Peter Zijlstra of Intel has been working on this scope-based resource management code and the initial infrastructure is ready for Linux 6.5. Developers now will be able to leverage this functionality and make use of it in various areas over the coming releases.
The scope-based resource management for the kernel is based around the new __cleanup() macro for the Linux kernel that wraps around the GCC and LLVM Clang "cleanup" attribute. The compiler "cleanup" attribute allows for defining a function to be called when a variable goes out-of-scope and the compiler will ensure that memory is properly freed to avoid memory leaks. This support has been worked on by Zijlstra as part of his kernel lock and pointer guards code.
This pull request merged today on the US Independence Day adds the scope-based resource management infrastructure. But it's left for future merge windows (or trying to still squeeze this week into Linux 6.5 albeit unlikely) for actually converting existing code to make use of this __cleanup() infrastructure.
39 Comments