zpp
Zephyr C++20 Framework
memory.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021 Erwin Rol <erwin@erwinrol.com>
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6 
7 #ifndef ZPP_INCLUDE_ZPP_MEMORY_HPP
8 #define ZPP_INCLUDE_ZPP_MEMORY_HPP
9 
10 #include <zephyr/kernel.h>
11 #include <zephyr/sys/__assert.h>
12 
13 #include <new>
14 
15 [[nodiscard]] void* operator new(std::size_t) noexcept
16 {
17  return nullptr;
18 }
19 
20 [[nodiscard]] void* operator new[](std::size_t) noexcept
21 {
22  return nullptr;
23 }
24 
25 [[nodiscard]] void* operator new(std::size_t, std::align_val_t) noexcept
26 {
27  return nullptr;
28 }
29 
30 [[nodiscard]] void* operator new[](std::size_t, std::align_val_t) noexcept
31 {
32  return nullptr;
33 }
34 
35 [[nodiscard]] void* operator new(std::size_t, const std::nothrow_t&) noexcept
36 {
37  return nullptr;
38 }
39 
40 [[nodiscard]] void* operator new[](std::size_t, const std::nothrow_t&) noexcept
41 {
42  return nullptr;
43 }
44 
45 [[nodiscard]] void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) noexcept
46 {
47  return nullptr;
48 }
49 
50 [[nodiscard]] void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) noexcept
51 {
52  return nullptr;
53 }
54 
55 #endif // ZPP_INCLUDE_ZPP_MEMORY_HPP