summaryrefslogtreecommitdiffhomepage
path: root/dev/LibC++/new.h
blob: 3ac60d7b767d3dfe0c580ea67f9eb678b08a8a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* -------------------------------------------

  Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.

------------------------------------------- */

#pragma once

#include <LibC++/defines.h>

namespace std {
struct placement_new;

/// =========================================================
/// @brief Disambugate non-throwing allocation functions.
/// =========================================================
struct nothrow_t {
  explicit nothrow_t() = default;
};

/// =========================================================
/// @brief Placement new metadata.
/// =========================================================
struct placement_new {
  void*     __base;
  int       __align;
  long long __size;
};

using placement_new_t = placement_new;
}  // namespace std

void* operator new(size_t);
void* operator new[](size_t);

void* operator new(size_t, const std::nothrow_t&) noexcept;
void* operator new(size_t, void*) noexcept;
void* operator new[](size_t, const std::nothrow_t&) noexcept;
void* operator new[](size_t, void*) noexcept;

void operator delete(void*) noexcept;
void operator delete(void*, size_t) noexcept;

void operator delete[](void*) noexcept;