Revert "AK+LibC: Move non-placement new/delete into LibC"

This reverts commit 2c82347393.
This commit is contained in:
Andreas Kling 2020-05-20 15:52:12 +02:00
parent 0c5e441a0b
commit bded472ec4
Notes: sideshowbarker 2024-07-19 06:19:00 +09:00
2 changed files with 30 additions and 30 deletions

View file

@ -52,6 +52,36 @@
# ifdef __serenity__
inline void* operator new(size_t size)
{
return kmalloc(size);
}
inline void operator delete(void* ptr)
{
return kfree(ptr);
}
inline void operator delete(void* ptr, size_t)
{
return kfree(ptr);
}
inline void* operator new[](size_t size)
{
return kmalloc(size);
}
inline void operator delete[](void* ptr)
{
return kfree(ptr);
}
inline void operator delete[](void* ptr, size_t)
{
return kfree(ptr);
}
inline void* operator new(size_t, void* ptr)
{
return ptr;

View file

@ -439,33 +439,3 @@ void __malloc_init()
new (&big_allocators()[0])(BigAllocator);
}
}
void* operator new(size_t size)
{
return malloc(size);
}
void* operator new[](size_t size)
{
return malloc(size);
}
void operator delete(void* ptr)
{
return free(ptr);
}
void operator delete(void* ptr, size_t)
{
return free(ptr);
}
void operator delete[](void* ptr)
{
return free(ptr);
}
void operator delete[](void* ptr, size_t)
{
return free(ptr);
}