Move new / delete kernel_cpp.h -> kernel_cpp.cpp
new and delete may not be defined as inline, as Clang loudly complains. The same is true for static.
This commit is contained in:
parent
b310316956
commit
71e0324992
@ -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 <new>, 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
|
||||
|
@ -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 <new>, 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user