-
Notifications
You must be signed in to change notification settings - Fork 153
feat: Add stacksafe feature #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,6 +157,7 @@ pub fn compute_root_layout(tree: &mut impl LayoutPartialTree, root: NodeId, avai | |
| /// Attempts to find a cached layout for the specified node and layout inputs. | ||
| /// | ||
| /// Uses the provided closure to compute the layout (and then stores the result in the cache) if no cached layout is found. | ||
| #[cfg_attr(feature = "stacksafe", stacksafe::stacksafe)] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing from here might help perf, because this function gets called just prior to Taffy reading from it's cache. It's also probably not necessary here, because:
|
||
| #[inline(always)] | ||
| pub fn compute_cached_layout<Tree: CacheTree + ?Sized, ComputeFunction>( | ||
| tree: &mut Tree, | ||
|
|
@@ -208,6 +209,7 @@ pub fn round_layout(tree: &mut impl RoundTree, node_id: NodeId) { | |
| return round_layout_inner(tree, node_id, 0.0, 0.0); | ||
|
|
||
| /// Recursive function to apply rounding to all descendents | ||
| #[cfg_attr(feature = "stacksafe", stacksafe::stacksafe)] | ||
| fn round_layout_inner(tree: &mut impl RoundTree, node_id: NodeId, cumulative_x: f32, cumulative_y: f32) { | ||
| let unrounded_layout = tree.get_unrounded_layout(node_id); | ||
| let mut layout = unrounded_layout; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -346,6 +346,7 @@ where | |
| } | ||
|
|
||
| #[inline(always)] | ||
| #[cfg_attr(feature = "stacksafe", stacksafe::stacksafe)] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also remove here for same reason as above. This is just prior to hitting the cache, and we'd like to only run this check if we get a cache miss to keep cache access fast. |
||
| fn compute_child_layout(&mut self, node: NodeId, inputs: LayoutInput) -> LayoutOutput { | ||
| // If RunMode is PerformHiddenLayout then this indicates that an ancestor node is `Display::None` | ||
| // and thus that we should lay out this node using hidden layout regardless of it's own display style. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect this and
perform_final_layout_on_in_flow_childrenaren't necessary, but are probably harmless.