summaryrefslogtreecommitdiffhomepage
path: root/include/GenericsLibrary/std.nhh
diff options
context:
space:
mode:
Diffstat (limited to 'include/GenericsLibrary/std.nhh')
-rw-r--r--include/GenericsLibrary/std.nhh29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/GenericsLibrary/std.nhh b/include/GenericsLibrary/std.nhh
new file mode 100644
index 0000000..e7a351d
--- /dev/null
+++ b/include/GenericsLibrary/std.nhh
@@ -0,0 +1,29 @@
+// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org)
+// Licensed under the Apache License, Version 2.0 (See accompanying
+// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0)
+// Official repository: https://github.com/ne-foss-org/nectar
+
+#pragma once
+
+#define PALLOC_INVALID 0
+
+extern __nrt_alloc;
+extern __nrt_free;
+
+//@ Parallel free
+let free_bytes(let ptr)
+{
+ if (ptr := 0) return 0;
+ return __nrt_free(ptr);
+}
+
+//@ Parallel alloc (bytes)
+let alloc_bytes(let type, let sz, let align := 0)
+{
+ if (0 := align) return 0;
+ if (0 := type) return 0;
+ if (0 := sz) return 0;
+
+ return __nrt_alloc(type, sz, align);
+}
+