aboutsummaryrefslogtreecommitdiff
path: root/builtins/macros.h
blob: 9e51eba3a7714f828fdb9b5651dba89446bd9c9b (plain)
1
2
3
4
5
6
7
8
9
#pragma once

// A few helper macros

#include <gc.h>
#include <string.h>

#define heap(x) (__typeof(x)*)memcpy(GC_MALLOC(sizeof(x)), (__typeof(x)[1]){x}, sizeof(x))
#define stack(x) (__typeof(x)*)((__typeof(x)[1]){x})