diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-30 18:46:00 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-30 19:56:02 +0200 |
| commit | a9d87cbd143b05cc3de711d84401f8ef514f3aa3 (patch) | |
| tree | cfc703f1dc02f6894b4d6d173d18d84be5757c5f /dev/ZKA/NewKit | |
| parent | 5229ca8ae190c0cb3db8d381a44be4113e81d5dc (diff) | |
[IMP] Updated the ARM64 release of ZKA.
[IMP] Shall use the timer on AMD64 by default, a SMP driver will be written if needed.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/NewKit')
| -rw-r--r-- | dev/ZKA/NewKit/Array.hxx | 7 | ||||
| -rw-r--r-- | dev/ZKA/NewKit/Macros.hxx | 6 | ||||
| -rw-r--r-- | dev/ZKA/NewKit/Ref.hxx | 17 |
3 files changed, 12 insertions, 18 deletions
diff --git a/dev/ZKA/NewKit/Array.hxx b/dev/ZKA/NewKit/Array.hxx index 1a2f6e86..dcb6aede 100644 --- a/dev/ZKA/NewKit/Array.hxx +++ b/dev/ZKA/NewKit/Array.hxx @@ -21,12 +21,9 @@ namespace Kernel Array& operator=(const Array&) = default; Array(const Array&) = default; - ErrorOr<T*> operator[](Size At) + T& operator[](const SizeT& At) { - if (At > N) - return {}; - - return ErrorOr<T*>(&fArray[At]); + return (fArray[At]); } Boolean Empty() const diff --git a/dev/ZKA/NewKit/Macros.hxx b/dev/ZKA/NewKit/Macros.hxx index db9d6ad9..2ecf2319 100644 --- a/dev/ZKA/NewKit/Macros.hxx +++ b/dev/ZKA/NewKit/Macros.hxx @@ -52,9 +52,9 @@ #define ATTRIBUTE(X) __attribute__((X)) #endif // #ifndef ATTRIBUTE -#ifndef __MAHROUSS_VER__ -#define __MAHROUSS_VER__ (2024) -#endif // !__MAHROUSS_VER__ +#ifndef __ZKA_VER__ +#define __ZKA_VER__ (2024) +#endif // !__ZKA_VER__ #ifndef EXTERN_C #define EXTERN_C extern "C" diff --git a/dev/ZKA/NewKit/Ref.hxx b/dev/ZKA/NewKit/Ref.hxx index 14d66f0a..3764611c 100644 --- a/dev/ZKA/NewKit/Ref.hxx +++ b/dev/ZKA/NewKit/Ref.hxx @@ -10,6 +10,7 @@ #include <NewKit/Defines.hxx> #include <NewKit/KernelCheck.hxx> +#include <KernelKit/Heap.hxx> namespace Kernel { @@ -18,14 +19,7 @@ namespace Kernel { public: Ref() = default; - - ~Ref() - { - if (fStrong) - { - fClass = nullptr; - } - } + ~Ref() = default; public: Ref(T cls, const bool& strong = false) @@ -35,12 +29,15 @@ namespace Kernel Ref& operator=(T ref) { + if (!fClass) + fClass = (T*)mm_new_ke_heap(sizeof(T), false, false); + *fClass = ref; return *this; } public: - T operator->() const + T& operator->() const { return *fClass; } @@ -72,7 +69,7 @@ namespace Kernel } private: - T* fClass; + T* fClass{nullptr}; Bool fStrong{false}; }; |
