diff --git a/AK/kmalloc.h b/AK/kmalloc.h index 6ef4caed0eb..c5a7a13e26f 100644 --- a/AK/kmalloc.h +++ b/AK/kmalloc.h @@ -52,36 +52,6 @@ # 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; diff --git a/Libraries/LibC/malloc.cpp b/Libraries/LibC/malloc.cpp index 500788c89b8..eb28a46d057 100644 --- a/Libraries/LibC/malloc.cpp +++ b/Libraries/LibC/malloc.cpp @@ -439,3 +439,33 @@ 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); +}