summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/NeKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-01 02:39:24 -0500
committerGitHub <noreply@github.com>2025-12-01 02:39:24 -0500
commitcd0c176275687a552bc546395bd2a39c92a3dd1b (patch)
treed6ddc16fd59d851a093700bad8dd8baca1c914dc /src/kernel/NeKit
parent82f7d186848681e2530c9fa8b196b55fad0f4823 (diff)
parent9c3de597257be9911a5eeb86c33962b15d87a701 (diff)
Merge pull request #98 from nekernel-org/develop
Develop: Updated paper, containers, and container types.
Diffstat (limited to 'src/kernel/NeKit')
-rw-r--r--src/kernel/NeKit/KernelPanic.h8
-rw-r--r--src/kernel/NeKit/OwnPtr.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/kernel/NeKit/KernelPanic.h b/src/kernel/NeKit/KernelPanic.h
index cba8897c..a12ff73c 100644
--- a/src/kernel/NeKit/KernelPanic.h
+++ b/src/kernel/NeKit/KernelPanic.h
@@ -9,11 +9,8 @@
#include <NeKit/Config.h>
-namespace Kernel {
-void ke_runtime_check(bool expr, const Char* file, const Char* line);
-}
-
-#define MUST_PASS_COMPILER(EXPR, MSG) static_assert(EXPR, MSG)
+/// @brief Checks during compile time whether a condition passes.
+#define STATIC_PASS(EXPR, MSG) static_assert(EXPR, MSG)
#ifdef TRY
#undef TRY
@@ -65,5 +62,6 @@ enum RUNTIME_CHECK {
typedef enum RUNTIME_CHECK RTL_RUNTIME_CHECK;
namespace Kernel {
+void ke_runtime_check(bool expr, const Char* file, const Char* line);
void ke_panic(const Int32& id, const Char* message = nullptr);
} // namespace Kernel
diff --git a/src/kernel/NeKit/OwnPtr.h b/src/kernel/NeKit/OwnPtr.h
index 2c493b1b..18a31bd1 100644
--- a/src/kernel/NeKit/OwnPtr.h
+++ b/src/kernel/NeKit/OwnPtr.h
@@ -10,6 +10,7 @@
#include <NeKit/Config.h>
#include <NeKit/KernelPanic.h>
#include <NeKit/Ref.h>
+#include <NeKit/ErrorOr.h>
namespace Kernel {
template <typename T>
@@ -56,8 +57,11 @@ class OwnPtr final {
T* fCls{nullptr};
};
+template <typename T>
+using OwnOr = ErrorOr<OwnPtr<T>>;
+
template <typename T, typename... Args>
-inline OwnPtr<T> make_ptr(Args... args) {
+inline OwnPtr<T> make_ptr(Args&&... args) {
OwnPtr<T> ret;
ret.template New<Args...>(forward(args)...);