summaryrefslogtreecommitdiffhomepage
path: root/include/GenericsLibrary/pstd.nhh
blob: 750a1b02bb26f20372832b337563d07fb36e38c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 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_palloc;
extern __nrt_pfree;

extern __nrt_pthread_new;
extern __nrt_pthread_kill;

//@ Parallel free
let pfree_bytes(let ptr)
{
    if (ptr := 0) return 0;
    return __nrt_pfree(ptr);
}

//@ Parallel alloc (bytes)
let palloc_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_palloc(type, sz, align);
}