Add comment on inlining

This commit is contained in:
Ayaz Hafiz 2022-10-31 09:43:28 -05:00
parent 07f5d0c7fd
commit b3956569a6
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -224,6 +224,9 @@ pub fn num_literal(
constraints.exists([num_var], and_constraint)
}
// Try not to be too clever about inlining, at least in debug builds.
// Inlining these tiny leaf functions can lead to death by a thousand cuts,
// where we end up with huge stack frames in non-tail-recursive functions.
#[cfg_attr(not(debug_assertions), inline(always))]
pub fn builtin_type(symbol: Symbol, args: Vec<Type>) -> Type {
Type::Apply(