Add new and delete C++ operators

This commit is contained in:
apio 2022-09-25 18:12:03 +02:00
parent 19dff40ee2
commit ae9967c462

32
kernel/src/misc/new.cpp Normal file
View File

@ -0,0 +1,32 @@
#include "std/stdlib.h"
#include <stddef.h>
void* operator new(size_t size)
{
return kmalloc(size);
}
void* operator new[](size_t size)
{
return kmalloc(size);
}
void operator delete(void* p)
{
kfree(p);
}
void operator delete[](void* p)
{
kfree(p);
}
void operator delete(void* p, size_t)
{
kfree(p);
}
void operator delete[](void* p, size_t)
{
kfree(p);
}