1 | //===-- Implementation of custom operator delete --------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "new.h" |
10 | #include <stdlib.h> |
11 | |
12 | void operator delete(void *mem) noexcept { ::free(ptr: mem); } |
13 | |
14 | void operator delete(void *mem, std::align_val_t) noexcept { ::free(ptr: mem); } |
15 | |
16 | void operator delete(void *mem, size_t) noexcept { ::free(ptr: mem); } |
17 | |
18 | void operator delete(void *mem, size_t, std::align_val_t) noexcept { |
19 | ::free(ptr: mem); |
20 | } |
21 | |
22 | void operator delete[](void *mem) noexcept { ::free(ptr: mem); } |
23 | |
24 | void operator delete[](void *mem, std::align_val_t) noexcept { ::free(ptr: mem); } |
25 | |
26 | void operator delete[](void *mem, size_t) noexcept { ::free(ptr: mem); } |
27 | |
28 | void operator delete[](void *mem, size_t, std::align_val_t) noexcept { |
29 | ::free(ptr: mem); |
30 | } |
31 | |