diff --git a/headers/private/kernel/util/kernel_cpp.h b/headers/private/kernel/util/kernel_cpp.h index c5c5373f32..9c5ab9a11b 100644 --- a/headers/private/kernel/util/kernel_cpp.h +++ b/headers/private/kernel/util/kernel_cpp.h @@ -22,65 +22,6 @@ extern const nothrow_t std::nothrow; typedef struct {} mynothrow_t; extern const mynothrow_t mynothrow; - -inline void * -operator new(size_t size) throw (std::bad_alloc) -{ - // we don't actually throw any exceptions, but we have to - // keep the prototype as specified in , or else GCC 3 - // won't like us - return malloc(size); -} - - -inline void * -operator new[](size_t size) throw (std::bad_alloc) -{ - return malloc(size); -} - - -inline void * -operator new(size_t size, const std::nothrow_t &) throw () -{ - return malloc(size); -} - - -inline void * -operator new[](size_t size, const std::nothrow_t &) throw () -{ - return malloc(size); -} - - -inline void * -operator new(size_t size, const mynothrow_t &) throw () -{ - return malloc(size); -} - - -inline void * -operator new[](size_t size, const mynothrow_t &) throw () -{ - return malloc(size); -} - - -inline void -operator delete(void *ptr) throw () -{ - free(ptr); -} - - -inline void -operator delete[](void *ptr) throw () -{ - free(ptr); -} - #endif // #if _KERNEL_MODE #endif // __cplusplus diff --git a/src/system/kernel/util/kernel_cpp.cpp b/src/system/kernel/util/kernel_cpp.cpp index 52ee3e660b..0ad305a2bc 100644 --- a/src/system/kernel/util/kernel_cpp.cpp +++ b/src/system/kernel/util/kernel_cpp.cpp @@ -73,6 +73,63 @@ __cxa_finalize(void* dsoHandle) // full C++ support in the kernel #if (defined(_KERNEL_MODE) || defined(_LOADER_MODE)) +void * +operator new(size_t size) throw (std::bad_alloc) +{ + // we don't actually throw any exceptions, but we have to + // keep the prototype as specified in , or else GCC 3 + // won't like us + return malloc(size); +} + + +void * +operator new[](size_t size) throw (std::bad_alloc) +{ + return malloc(size); +} + + +void * +operator new(size_t size, const std::nothrow_t &) throw () +{ + return malloc(size); +} + + +void * +operator new[](size_t size, const std::nothrow_t &) throw () +{ + return malloc(size); +} + + +void * +operator new(size_t size, const mynothrow_t &) throw () +{ + return malloc(size); +} + + +void * +operator new[](size_t size, const mynothrow_t &) throw () +{ + return malloc(size); +} + + +void +operator delete(void *ptr) throw () +{ + free(ptr); +} + + +void +operator delete[](void *ptr) throw () +{ + free(ptr); +} #ifndef _BOOT_MODE