diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-20 09:19:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-20 09:19:44 -0500 |
| commit | 274936aa8c14c09239f771bce5b5cc5b6ae507a2 (patch) | |
| tree | 6c16ac05bb73c7aea0bb4a69f5bc77c2f6ca2d77 /dev/LibC++ | |
| parent | 3cc0546417ed38c69a5ba0af1d7fd4c47af1401f (diff) | |
| parent | 56db5137ddd10f476b9820944b47ab72c6f8e019 (diff) | |
Merge pull request #25 from nekernel-org/dev
first set of patches to stable.
Diffstat (limited to 'dev/LibC++')
| -rw-r--r-- | dev/LibC++/filesystem.h | 2 | ||||
| -rw-r--r-- | dev/LibC++/new.cc | 8 | ||||
| -rw-r--r-- | dev/LibC++/new.h | 39 |
3 files changed, 37 insertions, 12 deletions
diff --git a/dev/LibC++/filesystem.h b/dev/LibC++/filesystem.h index 59e73a0..0a1a39a 100644 --- a/dev/LibC++/filesystem.h +++ b/dev/LibC++/filesystem.h @@ -9,6 +9,8 @@ #include <LibC++/defines.h> +/// @brief Filesystem module for LibC++ + namespace std { class path; class filesystem_error; diff --git a/dev/LibC++/new.cc b/dev/LibC++/new.cc new file mode 100644 index 0000000..4882652 --- /dev/null +++ b/dev/LibC++/new.cc @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. + +------------------------------------------- */ + +#include <LibC++/new.h> + diff --git a/dev/LibC++/new.h b/dev/LibC++/new.h index 8b09328..3ac60d7 100644 --- a/dev/LibC++/new.h +++ b/dev/LibC++/new.h @@ -1,4 +1,3 @@ - /* ------------------------------------------- Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. @@ -9,21 +8,37 @@ #include <LibC++/defines.h> -struct __placement_new_info; +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*, unsigned long) noexcept; +void operator delete(void*, size_t) noexcept; void operator delete[](void*) noexcept; - -/// ========================================================= -/// @brief Placement new information structure -/// ========================================================= -struct __placement_new_info { - void* __base; - int __align; - long long __size; -};
\ No newline at end of file |
