mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Kernel: Use AK::NeverDestroyed<Timer> to store the timer class
For an upcoming change to support interrupts in this driver, this class has to inherit from IRQHandler. That in turn will make this class virtual, which will then actually call the destructor of the class. We don't want this to happen, thus we have to wrap the class in a AK::NeverDestroyed.
This commit is contained in:
parent
a0b0c4e723
commit
8b77c61e7d
2 changed files with 4 additions and 4 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <AK/NeverDestroyed.h>
|
||||
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
|
||||
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
|
||||
#include <Kernel/Arch/aarch64/RPi/Timer.h>
|
||||
|
@ -35,8 +36,8 @@ Timer::Timer()
|
|||
|
||||
Timer& Timer::the()
|
||||
{
|
||||
static Timer instance;
|
||||
return instance;
|
||||
static AK::NeverDestroyed<Timer> instance;
|
||||
return *instance;
|
||||
}
|
||||
|
||||
u64 Timer::microseconds_since_boot()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue