feat(kernel): add hot and cold attributes to optimize function performance

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-03-22 03:04:23 +00:00
parent f9476d8c57
commit d06b6d3270
5 changed files with 20 additions and 17 deletions

View File

@ -31,7 +31,7 @@
#include <vm.hpp>
#include <vector>
int SpawnInit()
cold int SpawnInit()
{
const char *envp[6] = {
"PATH=/bin:/usr/bin",
@ -54,7 +54,7 @@ int SpawnInit()
nullptr, false, compat, true);
}
void KernelMainThread()
cold void KernelMainThread()
{
thisThread->SetPriority(Tasking::Critical);
@ -129,7 +129,7 @@ Exit:
}
NewLock(ShutdownLock);
void __no_stack_protector KernelShutdownThread(bool Reboot)
cold void __no_stack_protector KernelShutdownThread(bool Reboot)
{
SmartLock(ShutdownLock);
debug("KernelShutdownThread(%s)", Reboot ? "true" : "false");