From 575c4833104e5146885ce0f8488621c81b4fa480 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 5 Nov 2020 09:59:30 +0100 Subject: [PATCH] AK: Always include from compiler before our operators new We had competing inline definitions of the placement operators new. Avoid this by having pull in 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. --- AK/kmalloc.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/AK/kmalloc.h b/AK/kmalloc.h index 6ef4caed0e..5380fab9d0 100644 --- a/AK/kmalloc.h +++ b/AK/kmalloc.h @@ -52,6 +52,8 @@ # ifdef __serenity__ +# include + 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