openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
woz_alloc.h
1// Memory allocation and timing facade: qmalloc, qcalloc, qfree wrap the platform heap;
2// qrtc_get_us returns monotonic microseconds since boot.
3/*
4 * Copyright (c) 2026 asxeem
5 * SPDX-License-Identifier: ISC
6 * woz_alloc.h - thin heap + monotonic-clock wrappers over woz_port.h.
7 */
8#ifndef WOZ_ALLOC_H
9#define WOZ_ALLOC_H
10
11#include <stddef.h>
12#include <stdint.h>
13
14#include "woz_port.h"
15
21static inline void *qmalloc(size_t size)
22{
23 return woz_malloc(size);
24}
25
32static inline void *qcalloc(size_t nb_items, size_t item_size)
33{
34 return woz_calloc(nb_items, item_size);
35}
36
41static inline void qfree(void *ptr)
42{
43 woz_free(ptr);
44}
45
50static inline int64_t qrtc_get_us(void)
51{
52 return woz_uptime_us();
53}
54
55#endif /* WOZ_ALLOC_H */
Portable platform shim: allocates memory, measures uptime and cycle counts, provides sleep stubs for ...