µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os-inlines.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2016-2025 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software
6 * for any purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can
9 * be obtained from https://opensource.org/licenses/mit.
10 */
11
12#ifndef CMSIS_PLUS_RTOS_OS_INLINES_H_
13#define CMSIS_PLUS_RTOS_OS_INLINES_H_
14
15/*
16 * References are to ISO/IEC 14882:2011(E) Third edition (2011-09-01)
17 */
18
19// ----------------------------------------------------------------------------
20
21#if defined(__cplusplus)
22
23// ----------------------------------------------------------------------------
24
25namespace os
26{
27 namespace rtos
28 {
29 namespace internal
30 {
42 inline void*
43 object_named_system::operator new (std::size_t bytes)
44 {
45 assert (!interrupts::in_handler_mode ());
46
48 }
49
60 inline void*
61 object_named_system::operator new[] (std::size_t bytes)
62 {
63 // Forward array allocation to single element allocation.
64 return operator new (bytes);
65 }
66
79 inline void*
80 object_named_system::operator new (std::size_t, void* ptr)
81 {
82 return ptr;
83 }
84
96 inline void*
97 object_named_system::operator new[] (std::size_t bytes, void* ptr)
98 {
99 // Forward array allocation to single element allocation.
100 return operator new (bytes, ptr);
101 }
102
119 inline void
120 object_named_system::operator delete (void* ptr, std::size_t bytes)
121 {
122 assert (!interrupts::in_handler_mode ());
123
124 rtos::memory::allocator<char> ().deallocate (static_cast<char*> (ptr),
125 bytes);
126 }
127
140 inline void
141 object_named_system::operator delete[] (void* ptr, std::size_t bytes)
142 {
143 // Forward array deallocation to single element deallocation.
144 operator delete (ptr, bytes);
145 }
146
147 } /* namespace internal */
148 } /* namespace rtos */
149} /* namespace os */
150
151// ----------------------------------------------------------------------------
152
153#endif /* __cplusplus */
154
155// ----------------------------------------------------------------------------
156
157#endif /* CMSIS_PLUS_RTOS_OS_INLINES_H_ */
Standard allocator based on the RTOS system default memory manager.
Definition os-memory.h:538
void deallocate(value_type *addr, std::size_t elements) noexcept
Deallocate the number of memory blocks of type value_type.
value_type * allocate(std::size_t elements)
Allocate a number of memory blocks of type value_type.
bool in_handler_mode(void)
Check if the CPU is in handler mode.
Definition os-sched.h:1101
System namespace.