disable tail calls in bqn_fmt & bqn_repr

far from performance-critical, but helpful for stack traces
This commit is contained in:
dzaima 2024-07-12 18:07:00 +03:00
parent f79e4c6d0a
commit ed2198c06a

View File

@ -182,10 +182,16 @@ B compObj_c2(B t, B w, B x) {
return w;
}
#if __clang__
#define NO_TAIL_CALLS __attribute__((disable_tail_calls))
#else
#define NO_TAIL_CALLS __attribute__((optimize("-fno-optimize-sibling-calls")))
#endif
#if FORMATTER
GLOBAL B load_fmt, load_repr;
B bqn_fmt(B x) { return c1G(load_fmt, x); }
B bqn_repr(B x) { return c1G(load_repr, x); }
NO_TAIL_CALLS B bqn_fmt(B x) { return c1G(load_fmt, x); }
NO_TAIL_CALLS B bqn_repr(B x) { return c1G(load_repr, x); }
#else
B bqn_fmt(B x) { return x; }
B bqn_repr(B x) { return x; }