mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
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:
parent
2cf8649d0e
commit
575c483310
1 changed files with 2 additions and 9 deletions
11
AK/kmalloc.h
11
AK/kmalloc.h
|
@ -52,6 +52,8 @@
|
||||||
|
|
||||||
# ifdef __serenity__
|
# ifdef __serenity__
|
||||||
|
|
||||||
|
# include <new>
|
||||||
|
|
||||||
inline void* operator new(size_t size)
|
inline void* operator new(size_t size)
|
||||||
{
|
{
|
||||||
return kmalloc(size);
|
return kmalloc(size);
|
||||||
|
@ -82,15 +84,6 @@ inline void operator delete[](void* ptr, size_t)
|
||||||
return kfree(ptr);
|
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
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue