mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-15 07:01:42 +03:00
Add nullptr support to sized delete operators.
This commit is contained in:
parent
41aa41853c
commit
8115f05b26
2 changed files with 16 additions and 0 deletions
|
|
@ -118,11 +118,17 @@ void operator delete[](void *ptr, const std::nothrow_t &) noexcept
|
|||
void
|
||||
operator delete(void *ptr, std::size_t size) noexcept
|
||||
{
|
||||
if (unlikely(ptr == nullptr)) {
|
||||
return;
|
||||
}
|
||||
je_sdallocx(ptr, size, /*flags=*/0);
|
||||
}
|
||||
|
||||
void operator delete[](void *ptr, std::size_t size) noexcept
|
||||
{
|
||||
if (unlikely(ptr == nullptr)) {
|
||||
return;
|
||||
}
|
||||
je_sdallocx(ptr, size, /*flags=*/0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue