servo: Merge #18248 - stylo: Check stack depth in invalidation machinery and re-enable limits (from bholley:more_stack_limits); r=bholley
https://bugzilla.mozilla.org/show_bug.cgi?id=1376884 Source-Repo: https://github.com/servo/servo Source-Revision: 3c42792efade03a31b9eeca8be457992cf83722c
This commit is contained in:
@@ -34,6 +34,22 @@ use traversal::{DomTraversal, PerLevelTraversalData};
|
||||
/// The minimum stack size for a thread in the styling pool, in kilobytes.
|
||||
pub const STYLE_THREAD_STACK_SIZE_KB: usize = 128;
|
||||
|
||||
/// The stack margin. If we get this deep in the stack, we will skip recursive
|
||||
/// optimizations to ensure that there is sufficient room for non-recursive work.
|
||||
///
|
||||
/// When measured with 128KB stacks and 40KB margin, we could support 53
|
||||
/// levels of recursion before the limiter kicks in, on x86_64-Linux [1].
|
||||
///
|
||||
/// We currently use 45KB margins, because that seems to be the minimum amount
|
||||
/// of head room required by an unoptimized debug build, as measured on [2]. We
|
||||
/// could probably get away with a smaller margin on optimized release builds,
|
||||
/// but that would be a pain, and the extra padding reduces stability risk.
|
||||
///
|
||||
/// [1] See Gecko bug 1376883 for more discussion on the measurements.
|
||||
/// [2] layout/style/crashtests/1383981-3.html
|
||||
///
|
||||
pub const STACK_SAFETY_MARGIN_KB: usize = 45;
|
||||
|
||||
/// The maximum number of child nodes that we will process as a single unit.
|
||||
///
|
||||
/// Larger values will increase style sharing cache hits and general DOM
|
||||
|
||||
Reference in New Issue
Block a user