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
12void operator delete(void *mem) noexcept { ::free(ptr: mem); }
13
14void operator delete(void *mem, std::align_val_t) noexcept { ::free(ptr: mem); }
15
16void operator delete(void *mem, size_t) noexcept { ::free(ptr: mem); }
17
18void operator delete(void *mem, size_t, std::align_val_t) noexcept {
19 ::free(ptr: mem);
20}
21
22void operator delete[](void *mem) noexcept { ::free(ptr: mem); }
23
24void operator delete[](void *mem, std::align_val_t) noexcept { ::free(ptr: mem); }
25
26void operator delete[](void *mem, size_t) noexcept { ::free(ptr: mem); }
27
28void operator delete[](void *mem, size_t, std::align_val_t) noexcept {
29 ::free(ptr: mem);
30}
31

source code of libc/src/__support/CPP/new.cpp