aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--atom.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/atom.c b/atom.c
index 2167442..9496390 100644
--- a/atom.c
+++ b/atom.c
@@ -8,6 +8,13 @@ struct atom true_atom = { ATOM_TRUE };
struct atom false_atom = { ATOM_FALSE };
struct atom nil_atom = { ATOM_NIL } ;
+__attribute__((constructor))
+static void setup_builtin_atoms()
+{
+ nil_atom.list = calloc(1, sizeof(*nil_atom.list));
+ LIST_INIT(nil_atom.list);
+}
+
struct atom *atom_new(char type)
{
struct atom *atom = calloc(1, sizeof(*atom));