From 333fed96b7ccd3ee4f5f097445408dde34d330db Mon Sep 17 00:00:00 2001 From: amlal Date: Thu, 21 Mar 2024 00:38:52 +0100 Subject: Kernel: See below. - Fix kernel heap, made it better. - Fix System.Core, made it better. Signed-off-by: amlal --- Public/Kits/System.Core/Heap.hxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Public/Kits/System.Core/Heap.hxx') diff --git a/Public/Kits/System.Core/Heap.hxx b/Public/Kits/System.Core/Heap.hxx index 1bfc00de..6bad93e0 100644 --- a/Public/Kits/System.Core/Heap.hxx +++ b/Public/Kits/System.Core/Heap.hxx @@ -56,4 +56,24 @@ class Heap final { SizeT Size(HeapPtr me) noexcept; HeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags); }; + + +/// @brief heap exception +/// Throws when the heap pointer isn't found or invalid. +class HeapException : public SystemException { + public: + explicit HeapException() = default; + virtual ~HeapException() = default; + + public: + HCORE_COPY_DEFAULT(HeapException); + + public: + const char *Name() override { return "HeapException"; } + const char *Reason() override { return mReason; } + + private: + const char *mReason{"System.Core: HeapException: Catastrophic failure!"}; +}; + } // namespace System \ No newline at end of file -- cgit v1.2.3