blob: 7afc90b8cee3660b3f307be3e35b743fe7066d65 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
#include "moonshine.h"
// Free variable when it goes out of scope
void cleanup_free(var *input) { print("Deallocation logic goes here ", input); }
#define auto_free __attribute__((cleanup(cleanup_free)))
#define create(type, name, ...) \
auto_free var cat(name, _parent) = __VA_ARGS__; \
type name = cat(name, _parent);
|