summaryrefslogtreecommitdiffhomepage
path: root/include/LibC++/new.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/LibC++/new.h')
-rw-r--r--include/LibC++/new.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/LibC++/new.h b/include/LibC++/new.h
index faa9da4..23bfa50 100644
--- a/include/LibC++/new.h
+++ b/include/LibC++/new.h
@@ -24,16 +24,32 @@ struct placement_t final {
};
} // namespace std
-#ifndef __has_placement
-#define placement
+// AMLALE: Define the placement_t feature.
+#ifndef __cpp_has_placement
+#define __cpp_has_placement 1
+#endif
+
+// AMLALE: Define nothrow
+#ifndef __cpp_has_nothrow
+#define __cpp_has_nothrow 1
#endif
void* operator new(size_t);
void* operator new[](size_t);
-void* operator new(size_t, const std::nothrow_t&) noexcept;
+/// \brief placement_t new and delete operators. Governs how the memory shall be placed.
+/// \note This is a feature that shall be used wisely, failure to do so will produce Undefined Behaviors at runtime.
+void* operator _placement_new(size_t);
+void operator _placement_delete(void*);
+
+/// \note This should NOT fail, failure to meet the conditions will cause the program's state to be aborted.
+/// \brief Set the placement policy of future memory allocations.
+template <class PlaceableType>
+void set_placement_policy(const PlaceableType&) noexcept;
+
+void* operator new(size_t, const 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, const nothrow_t&) noexcept;
void* operator new[](size_t, void*) noexcept;
void operator delete(void*) noexcept;