diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-02-06 21:01:26 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-02-06 21:01:26 +0100 |
| commit | 8b73f2bac34c36a0ec008fb1e55aad77eb219afa (patch) | |
| tree | 4c591c9eb60b5d0e9a1790c8757b1c2a876170b1 | |
| parent | 82bf2d114698518645b76e5f9eb8f25ed9259d7b (diff) | |
MemoryMgr.h: Tweak mm_new_class to return if either allocation is successful or not.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | dev/Kernel/KernelKit/MemoryMgr.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dev/Kernel/KernelKit/MemoryMgr.h b/dev/Kernel/KernelKit/MemoryMgr.h index 05288704..1c42d71d 100644 --- a/dev/Kernel/KernelKit/MemoryMgr.h +++ b/dev/Kernel/KernelKit/MemoryMgr.h @@ -62,16 +62,17 @@ namespace Kernel /// @param cls The class to allocate. /// @param args The args to pass. template <typename T, typename... Args> - inline Void mm_new_class(_Input _Output T** cls, _Input Args&&... args) + inline BOOL mm_new_class(_Input _Output T** cls, _Input Args&&... args) { if (*cls) { err_global_get() = Kernel::kErrorInvalidData; - return; + return NO; } *cls = new T(move(args)...); - } + return *cls; + } /// @brief Delete and nullify C++ class. /// @param cls The class to delete. |
