diff --git a/src/h.h b/src/h.h index 1ea7b66d..8f2c6c25 100644 --- a/src/h.h +++ b/src/h.h @@ -53,6 +53,8 @@ const u16 OBJ_TAG = 0b1111111111110110; // 1111111111110110ppppppppppppppppppppp const u16 ARR_TAG = 0b1111111111110111; // 1111111111110111ppppppppppppppppppppppppppppppppppppppppppppp000 array (everything else is an atom) const u16 VAL_TAG = 0b1111111111110 ; // 1111111111110................................................... pointer to Value, needs refcounting +void cbqn_init(); + enum Type { /* 0*/ t_empty, // empty bucket placeholder /* 1*/ t_funBI, t_fun_block, diff --git a/src/main.c b/src/main.c index f27b14fb..0e026a41 100644 --- a/src/main.c +++ b/src/main.c @@ -69,21 +69,7 @@ Block* ca3(B x) { int main() { - hdr_init(); - harr_init(); - fillarr_init(); - i32arr_init(); - c32arr_init(); - f64arr_init(); - arith_init(); - fns_init(); - sfns_init(); - md1_init(); - md2_init(); - sysfn_init(); - derv_init(); - comp_init(); - rtPerf_init(); + cbqn_init(); B fruntime[] = { diff --git a/src/stuff.c b/src/stuff.c index 6336df01..4d1039e3 100644 --- a/src/stuff.c +++ b/src/stuff.c @@ -319,3 +319,14 @@ void printAllocStats() { #endif #endif } + +#define FOR_INIT(F) F(hdr) F(harr) F(fillarr) F(i32arr) F(c32arr) F(f64arr) F(arith) F(fns) F(sfns) F(md1) F(md2) F(sysfn) F(derv) F(comp) F(rtPerf) +#define F(X) static inline void X##_init(); +FOR_INIT(F) +#undef F +void cbqn_init() { + #define F(X) X##_init(); + FOR_INIT(F) + #undef F +} +#undef FOR_INIT \ No newline at end of file