[libc][NFC] Move aligned access implementations to separate header
[llvm-project.git] / libc / src / __support / CPP / new.cpp
blob5a40d4a6d3b272a4735feb9f1f60ed316855985a
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 //===----------------------------------------------------------------------===//
9 #include "new.h"
10 #include <stdlib.h>
12 void operator delete(void *mem) noexcept { ::free(mem); }
14 void operator delete(void *mem, std::align_val_t) noexcept { ::free(mem); }
16 void operator delete(void *mem, size_t) noexcept { ::free(mem); }
18 void operator delete(void *mem, size_t, std::align_val_t) noexcept {
19 ::free(mem);
22 void operator delete[](void *mem) noexcept { ::free(mem); }
24 void operator delete[](void *mem, std::align_val_t) noexcept { ::free(mem); }
26 void operator delete[](void *mem, size_t) noexcept { ::free(mem); }
28 void operator delete[](void *mem, size_t, std::align_val_t) noexcept {
29 ::free(mem);