diff options
Diffstat (limited to 'circuitpython/shared-module/qrio/quirc_alloc.h')
-rw-r--r-- | circuitpython/shared-module/qrio/quirc_alloc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/circuitpython/shared-module/qrio/quirc_alloc.h b/circuitpython/shared-module/qrio/quirc_alloc.h new file mode 100644 index 0000000..b01fac5 --- /dev/null +++ b/circuitpython/shared-module/qrio/quirc_alloc.h @@ -0,0 +1,14 @@ +#pragma once + +#include "py/gc.h" + +#if !MICROPY_GC_CONSERVATIVE_CLEAR +// so that we can implement calloc as m_malloc +#error Requires MICROPY_GC_CONSERVATIVE_CLEAR +#endif + +#define QUIRC_MALLOC(x) gc_alloc((x), 0, false) +#define QUIRC_CALLOC(x,y) gc_alloc((x) * (y), 0, false) +#define QUIRC_FREE(x) gc_free((x)) + +#define QUIRC_SMALL_STACK (1) |