µ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++ distribution.
3 * (https://github.com/micro-os-plus)
4 * Copyright (c) 2016-2023 Liviu Ionescu. All rights reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software
7 * for any purpose is hereby granted, under the terms of the MIT license.
8 *
9 * If a copy of the license was not distributed with this file, it can
10 * be obtained from https://opensource.org/licenses/mit/.
11 */
12
13#ifndef CMSIS_PLUS_RTOS_OS_INLINES_H_
14#define CMSIS_PLUS_RTOS_OS_INLINES_H_
15
16/*
17 * References are to ISO/IEC 14882:2011(E) Third edition (2011-09-01)
18 */
19
20// ----------------------------------------------------------------------------
21
22#if defined(__cplusplus)
23
24// ----------------------------------------------------------------------------
25
26namespace os
27{
28 namespace rtos
29 {
30 namespace internal
31 {
43 inline void*
44 object_named_system::operator new (std::size_t bytes)
45 {
46 assert (!interrupts::in_handler_mode ());
47
49 }
50
61 inline void*
62 object_named_system::operator new[] (std::size_t bytes)
63 {
64 // Forward array allocation to single element allocation.
65 return operator new (bytes);
66 }
67
80 inline void*
81 object_named_system::operator new (std::size_t, void* ptr)
82 {
83 return ptr;
84 }
85
97 inline void*
98 object_named_system::operator new[] (std::size_t bytes, void* ptr)
99 {
100 // Forward array allocation to single element allocation.
101 return operator new (bytes, ptr);
102 }
103
121 inline void
122 object_named_system::operator delete (void* ptr, std::size_t bytes)
123 {
124 assert (!interrupts::in_handler_mode ());
125
127 static_cast<char*> (ptr), bytes);
128 }
129
142 inline void
143 object_named_system::operator delete[] (void* ptr, std::size_t bytes)
144 {
145 // Forward array deallocation to single element deallocation.
146 operator delete (ptr, bytes);
147 }
148
149 } /* namespace internal */
150 } /* namespace rtos */
151} /* namespace os */
152
153// ----------------------------------------------------------------------------
154
155#endif /* __cplusplus */
156
157// ----------------------------------------------------------------------------
158
159#endif /* CMSIS_PLUS_RTOS_OS_INLINES_H_ */
Standard allocator based on the RTOS system default memory manager.
Definition os-memory.h:540
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:1108
System namespace.