AK: Always include <new> from compiler before our operators new

We had competing inline definitions of the placement operators new.
Avoid this by having <AK/kmalloc.h> pull in <new> from the compiler
and always using their definitions instead.

I feel like there must be an elegant solution to this whole situation
with the operators, but I'm not sure what it is.
This commit is contained in:
Andreas Kling 2020-11-05 09:59:30 +01:00
parent 2cf8649d0e
commit 575c483310

View file

@ -52,6 +52,8 @@
# ifdef __serenity__
# include <new>
inline void* operator new(size_t size)
{
return kmalloc(size);
@ -82,15 +84,6 @@ inline void operator delete[](void* ptr, size_t)
return kfree(ptr);
}
inline void* operator new(size_t, void* ptr)
{
return ptr;
}
inline void* operator new[](size_t, void* ptr)
{
return ptr;
}
# endif
#endif