diff options
| author | amlal <amlal@el-mahrouss-logic.com> | 2024-03-16 14:22:21 +0100 |
|---|---|---|
| committer | amlal <amlal@el-mahrouss-logic.com> | 2024-03-16 14:22:21 +0100 |
| commit | 55059428bfd6a18451bc1ed3ee64e7bb04c395cd (patch) | |
| tree | 02dd524a2249111e30d2208fd700fa72e31182db /Public/Kits/System.Core/Heap.hxx | |
| parent | 8f9b5e08f53f6e49a1f4c6b20e17c54298da9c44 (diff) | |
HCR-14: See below.
- Pretty big modifications, add kernel mouse.
Signed-off-by: amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Kits/System.Core/Heap.hxx')
| -rw-r--r-- | Public/Kits/System.Core/Heap.hxx | 62 |
1 files changed, 62 insertions, 0 deletions
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 <System.Core/Defs.hxx> +#include <CompilerKit/CompilerKit.hxx> + +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 |
