Scope-based resource management for the kernel
Scope-based resource management for the kernel
Posted Jun 16, 2023 17:25 UTC (Fri) by Wol (subscriber, #4433)In reply to: Scope-based resource management for the kernel by mbunkus
Parent article: Scope-based resource management for the kernel
> The examples that were given sounded very un-C++-like to me as both cases could easily be solved in the usual C++-RAII style by storing copies of the relevant pointers inside the class. But the arguments against that was "no, bad for performance" (paraphrasing).
For the kernel, yes. Don't forget, if your structures grow in size, you're talking cache misses, cache eviction, cache line bounce, etc. All of which can be VERY expensive.
Cheers,
Wol