Skip to content

Commit

Permalink
Mark some methods of Kernel noexcept because control flow is odd.
Browse files Browse the repository at this point in the history
Some methods of Kernel, such as vanish(), have odd control flow. Let's
mark these methods "noexcept" to prevent exceptions from being thrown
across these bounaries.
  • Loading branch information
foxostro committed Jan 27, 2019
1 parent 3485947 commit 73b7d0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Kernel/include/kernel.hpp
Expand Up @@ -27,19 +27,19 @@ class Kernel : private KernelPolicy {
void run();

// Redirect the interrupt to the appropriate handler.
void dispatch_interrupt(void* params)
void dispatch_interrupt(void* params) noexcept
{
interrupt_controller_.dispatch(params);
}

// The current thread yields to the next runnable thread.
void yield()
void yield() noexcept
{
scheduler_.yield();
}

// The current thread exits.
__attribute__((noreturn)) void vanish()
__attribute__((noreturn)) void vanish() noexcept
{
scheduler_.vanish();
}
Expand Down

0 comments on commit 73b7d0d

Please sign in to comment.