Skip to content

Commit ddc9485

Browse files
committed
docs(stylex_stylesheet): give the measured stack limit for a constant chain
The comment on MAX_CONSTANT_DEPTH said that V8 runs out of stack near 10,000 links. With the default stack, a new process runs out of stack after approximately 4,500 links. The comment now gives this number and tells that it changes with the platform and the JIT tier.
1 parent 58f09e6 commit ddc9485

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎crates/stylex-stylesheet/src/process.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ fn resolve_constants(
153153
}
154154

155155
/// The deepest chain of constants that `resolve_constant` follows. Real
156-
/// sheets chain two or three constants. V8 runs out of stack near 10,000
157-
/// links, so past this limit the reference decides: it resolves the chain, or
158-
/// it throws its own `RangeError`.
156+
/// sheets chain two or three constants. With the default stack, V8 can run
157+
/// out of stack after approximately 4,500 links. That number changes with the
158+
/// platform and the JIT tier. Past this limit the reference decides: it
159+
/// resolves the chain, or it throws its own `RangeError`.
159160
pub(crate) const MAX_CONSTANT_DEPTH: usize = 256;
160161

161162
/// `resolveConstant`: a constant's value with every reference to another

0 commit comments

Comments
 (0)