aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-08-20 21:12:46 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-08-20 21:12:46 +0100
commit3074ba5babaf39e4a177444a8ffb5f81b991440f (patch)
tree2f3c1cf7ea7f7646cf988f8b8b34ffe89abd5fbf /main.c
parent99396b05339ad7246eef79302c1ea8b1ae4003fc (diff)
downloadalisp-3074ba5babaf39e4a177444a8ffb5f81b991440f.tar.gz
alisp-3074ba5babaf39e4a177444a8ffb5f81b991440f.tar.bz2
alisp-3074ba5babaf39e4a177444a8ffb5f81b991440f.zip
Constructors and context -> sys
We can register memory we've allocated onto the heap into a ~sys_t~ instance for examination (read: garbage collection) later. We can also add items to the symbol table it has internally.
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/main.c b/main.c
index 75750ad..7ce10a5 100644
--- a/main.c
+++ b/main.c
@@ -27,16 +27,8 @@ sv_t sv_copy(sv_t old)
int main(void)
{
- i64 numbers[] = {
- 1, 1024, -200, 1LU << 32, INT_MAX, INT_MIN,
- };
-
- for (u64 i = 0; i < ARRSIZE(numbers); ++i)
- {
- i64 num = numbers[i];
- lisp_t *lisp = tag_int(num);
- i64 ret = as_int(lisp);
- printf("%#16lx => %#16lx => %#16lx\n", num, lisp, ret);
- }
+ sys_t sys;
+ sys_init(&sys);
+ sys_cleanup(&sys);
return 0;
}