diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-11 06:09:44 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-11 06:10:12 +0100 |
| commit | df7ef3ba6105cc414b69f2b0666d50dec7030536 (patch) | |
| tree | 4834dc3d781ae650c8efbfc516fe9bb3c2364ad5 /include/GenericsLibrary/std.nhh | |
| parent | 15e8d61fe493e62ae55ebea2cf4274d8b49338ae (diff) | |
[CHORE] Update GenericsLibrary include library.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/GenericsLibrary/std.nhh')
| -rw-r--r-- | include/GenericsLibrary/std.nhh | 29 |
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); +} + |
