kernel_cpp: Move the C++14 operator delete out of the header.

It seems not all of the kernel includes this, but some use new/delete
anyway. Further, operator delete[] was not implemented at all.

Possibly fixes the ARM build.
This commit is contained in:
Augustin Cavalier 2018-08-01 23:42:24 -04:00
parent cf36277e17
commit edb6d3b17b
2 changed files with 21 additions and 7 deletions

View File

@ -39,13 +39,8 @@ extern void operator delete(void *ptr) _NOEXCEPT;
extern void operator delete[](void *ptr) _NOEXCEPT;
#if __cplusplus >= 201402L
inline void
operator delete(void *ptr, size_t size) throw ()
{
free(ptr);
}
extern void operator delete(void* ptr, std::size_t) _NOEXCEPT;
extern void operator delete[](void* ptr, std::size_t) _NOEXCEPT;
#endif // __cplusplus >= 201402L
#endif // #if _KERNEL_MODE

View File

@ -141,6 +141,25 @@ operator delete[](void *ptr) _NOEXCEPT
free(ptr);
}
#if __cplusplus >= 201402L
void
operator delete(void* ptr, std::size_t) _NOEXCEPT
{
free(ptr);
}
void
operator delete[](void* ptr, std::size_t) _NOEXCEPT
{
free(ptr);
}
#endif
#ifndef _BOOT_MODE
FILE *stderr = NULL;