kern: devirtualize KAutoObject::DynamicCast<>()
This is an optimization that saves the most common type of virtual call in the kernel (DynamicCast)
by storing class token as a member, rather than getting it via virtual call every time.

This does not currently cost any memory space on 64-bit targets, due to pre-existing padding space.

This optimization can be turned off via a compile-time flag for accuracy.
1 parent 26c02e2 commit bfffe6b119dbc3300b7fb3f0bd1e310e72856f13
@Michael Scire Michael Scire authored on 17 Oct 2021
Showing 3 changed files
View
libraries/libmesosphere/include/mesosphere/kern_build_config.hpp
View
libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp
View
libraries/libmesosphere/source/kern_k_auto_object.cpp