diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2014-05-18 10:39:50 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2014-05-18 10:39:50 +0300 |
| commit | cece5aa4d3c0ac2364045d1adda8c36e9359adc2 (patch) | |
| tree | 6dd5f04e7a9b5da9a5d736a2db0076e99445fab9 | |
| parent | 35c41f87bdadc49a8fcd8fcd8ed284f118416b46 (diff) | |
| download | lispish-cece5aa4d3c0ac2364045d1adda8c36e9359adc2.tar.gz lispish-cece5aa4d3c0ac2364045d1adda8c36e9359adc2.zip | |
init builtin atoms with gcc constructor
| -rw-r--r-- | atom.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)); |
