Define void operator delete[](void *p, std::size_t n) in new_delete.cpp (#430)

This commit is contained in:
Jonathan Reichelt Gjertsen 2021-05-24 23:47:29 +02:00 committed by GitHub
parent 048fcdefd6
commit cc8b2156fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,10 +17,16 @@ void *operator new[](std::size_t n) {
return std::malloc(n);
}
void operator delete(void *p, __unused std::size_t n) noexcept { std::free(p); }
void operator delete(void *p) { std::free(p); }
void operator delete[](void *p) noexcept { std::free(p); }
#if __cpp_sized_deallocation
void operator delete(void *p, __unused std::size_t n) noexcept { std::free(p); }
void operator delete[](void *p, __unused std::size_t n) noexcept { std::free(p); }
#endif
#endif