L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
std_alloc
1
// vi:set ft=cpp: -*- Mode: C++ -*-
2
/*
3
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
4
* Alexander Warg <warg@os.inf.tu-dresden.de>
5
* economic rights: Technische Universität Dresden (Germany)
6
*
7
* License: see LICENSE.spdx (in this directory or the directories above)
8
*/
9
10
#pragma once
11
12
#include <stddef.h>
13
namespace
cxx
{
19
class
Nothrow
{};
20
}
21
28
inline
void
*
operator
new
(size_t,
void
*mem,
cxx::Nothrow
const
&)
noexcept
29
{
return
mem; }
30
35
void
*
operator
new
(size_t,
cxx::Nothrow
const
&)
noexcept
;
36
42
void
operator
delete
(
void
*,
cxx::Nothrow
const
&)
noexcept
;
43
44
namespace
cxx
{
45
46
55
template
<
typename
_Type >
56
class
New_allocator
57
{
58
public
:
59
enum
{ can_free =
true
};
60
61
New_allocator
()
noexcept
{}
62
New_allocator
(
New_allocator
const
&)
noexcept
{}
63
64
~New_allocator
()
noexcept
{}
65
66
_Type *alloc()
noexcept
67
{
return
static_cast<
_Type*
>
(::operator
new
(
sizeof
(_Type),
cxx::Nothrow
())); }
68
69
void
free(_Type *t)
noexcept
70
{ ::operator
delete
(t,
cxx::Nothrow
()); }
71
};
72
73
}
74
cxx::New_allocator
Standard allocator based on operator new () .
Definition
std_alloc:57
cxx::Nothrow
Helper type to distinguish the operator new version that does not throw exceptions.
Definition
std_alloc:19
cxx
Our C++ library.
Definition
arith:11
l4
cxx
std_alloc
Generated on Fri May 23 2025 13:40:51 for L4Re Operating System Framework by
1.9.8