30#define MIN(a, b) __extension__ ({ __extension__ __auto_type _a = (a); __auto_type _b = (b); _a < _b ? _a : _b; })
31#define MAX(a, b) __extension__ ({ __extension__ __auto_type _a = (a); __auto_type _b = (b); _a > _b ? _a : _b; })
32#define pow2(x) ((__typeof__(x)) 1 << (x))
38#define kmalloc(item) _Generic((item), slab_t *: kmemcache_alloc, default: slab_alloc)(item)
56#define malloc(size) slab_alloc(size)
57#define calloc(nmemb, size) slab_calloc(nmemb, size)
58#define realloc(ptr, size) slab_realloc(ptr, size)
59#define free(ptr) slab_free(ptr)
MOSAPI s64 strtoll(const char *str, char **endptr, int base)
MOSAPI unsigned char tolower(unsigned char c)
MOSAPI pid_t spawn(const char *path, const char *const argv[])
MOSAPI unsigned long strtoul(const char *nptr, char **endptr, int base)
MOSAPI void format_size(char *buf, size_t buf_size, u64 size)
MOSAPI s64 strntoll(const char *str, char **endptr, int base, size_t n)
MOSAPI int atexit(void(*func)(void))
MOSAPI tid_t start_thread(const char *name, thread_entry_t entry, void *arg)
MOSAPI char * string_trim(char *in)
MOSAPI void exit(int status)
MOSAPI s32 atoi(const char *nptr)
void * slab_realloc(void *addr, size_t size)
Reallocate a block of memory from the slab allocator.
void slab_free(const void *addr)
Free a block of memory from the slab allocator.
void * slab_calloc(size_t nmemb, size_t size)
Allocate a block of memory from the slab allocator and zero it.
void(* thread_entry_t)(void *arg)