From 55059428bfd6a18451bc1ed3ee64e7bb04c395cd Mon Sep 17 00:00:00 2001 From: amlal Date: Sat, 16 Mar 2024 14:22:21 +0100 Subject: HCR-14: See below. - Pretty big modifications, add kernel mouse. Signed-off-by: amlal --- Public/Kits/System.Core/Heap.hxx | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Public/Kits/System.Core/Heap.hxx (limited to 'Public/Kits/System.Core/Heap.hxx') diff --git a/Public/Kits/System.Core/Heap.hxx b/Public/Kits/System.Core/Heap.hxx new file mode 100644 index 00000000..292a1227 --- /dev/null +++ b/Public/Kits/System.Core/Heap.hxx @@ -0,0 +1,62 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include +#include + +namespace System { +class MemoryException; + +typedef PVOID HeapPtr; + +enum { + kHeapExpandable = 2, + kHeapNoExecute = 4, + kHeapShared = 6, + kHeapReadOnly = 8, + kHeapNoFlags = 0 +}; + +class Heap final { + private: + explicit Heap(); + + public: + ~Heap(); + + public: + HCORE_COPY_DEFAULT(Heap); + + public: + static Heap *Shared() noexcept; + + public: + void Delete(HeapPtr me) noexcept; + SizeT Size(HeapPtr me) noexcept; + HeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags); +}; + +class MemoryException final { + public: + explicit MemoryException() = default; + ~MemoryException() = default; + + public: + HCORE_COPY_DEFAULT(MemoryException); + + public: + const char *Name(); + const char *Reason(); + + private: + const char *mReason{"System.Core: Process Heap Exception: Catastrophic failure!"}; + + private: + friend Heap; +}; +} // namespace System \ No newline at end of file -- cgit v1.2.3