added new override
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "thread.h"
|
||||
#include "../arch/core_ring.h"
|
||||
|
||||
#include "../memory/pageframealloc.h"
|
||||
#include "../debug/kernelpanic.h"
|
||||
#include "../interrupt/guard.h"
|
||||
#include "debug/output.h"
|
||||
@@ -52,6 +52,17 @@ void Thread::resume(Thread *next) {
|
||||
context_switch(&next->context, &context);
|
||||
}
|
||||
|
||||
void* operator new(std::size_t sz)
|
||||
{
|
||||
if (sz == 0)
|
||||
++sz; // avoid std::malloc(0) which may return nullptr on success
|
||||
|
||||
if (void *ptr = PagreFrameAllocator::alloc(true))
|
||||
return ptr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Thread::go() { context_launch(&context); }
|
||||
|
||||
void Thread::action() { kernelpanic("Wrong entry / missing action in Thread"); }
|
||||
|
||||
Reference in New Issue
Block a user